Community
Participate
Working Groups
Build Identifier: M20100909-0800 If the the following three classes are placed in different files conditional expression will throw a syntax error while the equivalent if-else construct is compiled without any errors. Javac compiles this classes without any problems. I guess this is the minimal class configuration to produce this behavior. The problem occurred in code generated from ANTLR. package pkg; public abstract class Upper<T> { public static enum Mode {IN,OUT;} } package pkg; public class Lower extends Upper<Lower> {} package pkg; public class Bug { Upper.Mode m1; void usage(){ //no syntax error Lower.Mode m3; if (m1 == null){ m3 = Lower.Mode.IN; } else { m3 = m1; } //syntax error Lower.Mode m2 = (m1 == null ? Lower.Mode.IN : m1); } } Reproducible: Always Steps to Reproduce: 1.Create classes 2.Save all files! 3.
Could you please provide your compiler settings ?
Please provide the jdt.core id. So far I cannot reproduce. The code compiles fine for me.
Oh, the classes are not complete yet: public abstract class Upper<T> must be public abstract class Upper<T extends Upper> But moving from the second version to the first does NOT remove the bug! My compiler level is 1.6 with default settings.
This seems to be fixed in HEAD (3.7). It is only a problem with the incremental builder. If you do a full build of your project, the error goes away. Srikanth, could you please investigate what change fixed this for 3.7 ? If not too risky, we might investigate backporting it for 3.6.2. The latest M-build still contains the bug.
The change to org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.isEquivalentTo(TypeBinding) made on behalf of the fix for bug 186565 seems to have taken care of this.
(In reply to comment #5) > The change to > org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.isEquivalentTo(TypeBinding) > made on behalf of the fix for bug 186565 seems to have taken care of > this. While the change to the method mentioned above ostensibly fixes the problem reported, the fix for bug 186565 was part of a large set of bug fixes (~25 or so) that were made to properly support mixed mode operations of 1.4 and 1.5 source/class files. It is unclear what is the effect of back porting just one fix to 3.6.2. As such, it is too late to include this for 3.6.2. I'll add a regression test for this on HEAD to capture the current case and close this as a duplicate of bug 186565.
Released org.eclipse.jdt.core.tests.builder.IncrementalTests.testBug334377() in HEAD for 3.7 M6. Resolving as WORKSFORME as this is not exactly a duplicate of bug 186565.
Verified for 3.7M6 using build I20110301-1537.