Community
Participate
Working Groups
Build Identifier: In Helios download ?jdt 3.6.0 /** <p>This code sample demonstrates what appears to be a bug in the Helios compiler. <p>The code as it stands generates the error "Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.core.compiler.CharOperation.hashCode(CharOperation.java:1930)" <p>The code compiles Ok with the Galileo compiler, or if any of the changes noted is made. */ public final class HeliosCompileBug{ private HeliosCompileBug(){ //Ok if final // final boolean flagSet = //Makes no difference if true or false true; Object first = //Ok if false // false true ? null : ""; Object second = flagSet || first == null ? null : //Ok if not anonymous class new Object() {} ; } } Reproducible: Always Steps to Reproduce: 1.Compile test code in Galileo, should be Ok 2.Compile in Helios, should fail 3.Make any of changes marked, should be Ok.
(In reply to comment #0) > Build Identifier: In Helios download ?jdt 3.6.0 > > /** > <p>This code sample demonstrates what appears to be a bug in the Helios > compiler. Reproduced on HEAD. Thanks for the report, I'll follow up.
Problem related to null references and flow analysis. We don't set the constant pool name since the code containing the anonymous type is found to be unreachable by one phase. But then another phase ignores the reachability and attempts to retrieve the constant pool name and operates on it ending up with NPE. Thus the left hand is unaware of what the right hand is doing. Ayush, please follow up. This is a regression in 3.6, so needs to be fixed for 3.6.1
Created attachment 176386 [details] Patch under consideration
Created attachment 176434 [details] Revised patch This patch passes all tests, Ayush, please review, TIA. I have left the hacks done for bug 102284 and bug intact.
(In reply to comment #4) > I have left the hacks done for bug 102284 and bug intact. Should read : I have left the hacks done for bug 102284 and bug 99686 intact.
(In reply to comment #4) > Created an attachment (id=176434) [details] > Revised patch > > > This patch passes all tests, Ayush, please review, TIA. > > I have left the hacks done for bug 102284 and bug intact. Patch looks good. +1 for 3.6.1
Released in HEAD for 3.7 M2 in 3.6 maintenance stream for 3.6.1
Verified for 3.6.1 using build M20100825-0800.
Verified for 3.7M2 using I20100914-0100