Bug fix

  • 9
  • Locked
The getExpectedMap method is used everywhere in your huge project. At some point, the testers discovered that the getExpectedMap method throws a NullPointerException. The expected behavior is described in the main method's comments.
You can't complete this task, because you're not signed in.
Comments (3)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Justin Smith
Level 38 , Greenfield, USA, United States
7 February, 12:29
Bad task. The "official" solution produces an output different from what it says it wants.
John Squirrels Website Admin at CodeGym
9 February, 08:40
Could you be more specific, please?
Justin Smith
Level 38 , Greenfield, USA, United States
9 February, 14:09
The commented output in the solution specifies:
/* Expected output
********* Add obj with key NULL *********
1
text 1
*********  Add obj with key 0 *********
2
text 1
text 2
********* Keys *********
0
null
********* Values *********
text 2
text 1
         */
However, if you copy/paste the solution, it will actually output the keys as:
null
0
and it will output Values as:
text 1
text 2
It will pass validation while generating this output, at least. But I was quite stuck for a while trying to figure out why my outputs were in reverse order, and eventually gave up and pasted in the solution, only to find that it was doing exactly the same thing as my own solution.