A stupid Mistake


the above mistake cost me close to 1 hour. Can you spot the mistake?

I tried all these possibilities:




and then realized my stupid mistake.

I have installed sonar plugin, it suggested me to “Extract this nested code block into a method”. I thought it was suggesting me to extract the nested if statements into a method.

Anyways I guess I needed a break, I left for the day after struggling to resolve it. And I figured out the mistake next day morning with a fresh pair of eyes.


Leave a Reply