Community
Participate
Working Groups
R3.0 On following code, we are not generating the proper variable entry in local variable attribute: public class X { public static void main(String[] args) { int i; outer: { if (args == null) { i = 0; break outer; } return; } System.out.println(i); // no entry in var attribute } } Thus if breaking in debugging on println(i) line, the variable 'i' isn't visible where it should be.
we should generate sthg like: Local variable table: [pc: 6, pc: 9] local: i index: 1 type: I [pc: 0, pc: 18] local: args index: 0 type: [Ljava/lang/String; [pc: 10, pc: 18] local: i index: 1 type: I
Similar issue with do-while statement.
Similar issue for all control flow statements (including foreach).
The following templates where missing #addDefinitelyAssignedVariables. if (mergedInitStateIndex != -1) { codeStream.removeNotDefinitelyAssignedVariables( currentScope, mergedInitStateIndex); codeStream.addDefinitelyAssignedVariables( currentScope, mergedInitStateIndex); } codeStream.recordPositionsFrom(pc, this.sourceStart);
Could be backported to 3.0 maintenance stream. Fixed in 1.5 stream, added regression tests: ConformTest#test241-244 + ForeachStatementTest#test027.
Backported to 3.0.x stream.
Verified for 3.0.1 RC1