Do a javap -l on the following code:
and the printit method will look something like this:
Notice that the LineNumberTable has 3 entries, but the original method has only 2 instruction lines of code. The first, rogue line number corresponds to the method's block statement.
The problem is that there are 2 entries corresponding to the #4 instruction. This occasionally confuses the debugger when it is trying to install the breakpoint on a running app (ie- sometimes it works and sometimes it does not).
I tracked the problem down to AsmClassGenerator.visitBlockStatement(), which calls the onLineNumber method and (incorrectly, it seems) adds a line number entry for the start of the block statement. Simply commenting this line out (line 721 on version 1.7.5) appears to work for me.
Is there any reason why we should not go ahead with the fix?