Community
Participate
Working Groups
Test case: public class TestBug { final boolean isA = true; public static void main(String[] args) { TestBug test = new TestBug(); System.out.println(test.isA ? "A" : "B"); } } Following bug 100162, the code gen for this test case to be optimized. We should generate the null check and then inline the true/false expression according to the constant value.
Our latest 3.2 build issues: public static void main(String[] args); 0 new X [1] 3 dup 4 invokespecial X() [22] 7 astore_1 [test] 8 getstatic System.out : PrintStream [23] 11 aload_1 [test] 12 invokevirtual Object.getClass() : Class [29] 15 pop 16 ldc <String "A"> [33] 18 invokevirtual PrintStream.println(String) : void [35] 21 return This is likely a consequence of our boolean codegen optimization earlier in 3.2 stream. Olivier - could you pls add a testcase validating the codegen output ?