Community
Participate
Working Groups
Build ID: I20080502-0100 Steps To Reproduce: 1. create a new java project 2. add the class "java.util.TreeMap" from the GNU classpath project (http://www.gnu.org/software/classpath/) 3. next to many other errors (due to other missing classes, wrong package declaration, etc), Eclipse also shows an Internal Compiler Error at Line 1. More information: Using Eclipse 3.4M7 on Mac OS X 10.5.2, running on Core 2 Duo (Intel-Architecture), using Apple's JVM 1.5.0. The same error does not show when using Eclipse 3.4M6a. Solving all the other errors shown by the compiler does not solve the NullPointerException at org.eclipse.jdt.internal.compiler.ast.CastExpression.checkUnsafeCast(CastExpression.java:300)
Could not reproduce. Could you please give more details on the version that doesn't compile? Compiler settings? Would it be possible for you to isolate a test case ? That would help us reproducing it and then fixing it. Thanks.
Thanks, your message made me play around a bit more: If I use a clean install of Eclipse 3.4M7 (no additional plugins installed) and open my *existing* workspace (created with Eclipse 3.2 or Eclipse 3.3 some while ago, contains 18 projects, not all Java), I get the mentioned error. I also get the error when I create a new java project in my existing workspace with the mentioned class in the buildpath. However, if I create a *new* workspace with a new project with the mentioned class, I do *not* get the error. So it seems to be somehow workspace-dependent, but not project-dependent. This may explain why you are not able to reproduce it. But still, the same *existing* playground in Eclipse 3.4M6a compiled without problems... I'll try to somehow reduce my existing workspace to fewer projects etc in the hope to isolate the problem -- but that might take a while. Is there something like "clean workspace", similar to "clean project"? Cleaning the projects didn't help, but as it seems to be workspace-dependent, "cleaning the workspace" might help if something like that is possible.
Please provide detailed steps to reproduce. I tried to checkout HEAD from CVS gnu classpath, and could not reproduce either. There were many other compiler errors, likely due to inconsistencies in the libs.
Created attachment 98640 [details] workspace with one project that does not compile in Eclipse 3.4M7 project in given workspace does not compile in Eclipse 3.4M7, but does in Eclipse 3.4M6a, on Mac OS X 10.5.2 (x86) and Apple-JVM 1.5.0
I just added an attachment to this bug (id=98640; 2008-05-05 10:50 -0400, 54.95KB). The attachment contains a very small workspace with one project "test", that contains 6 classes from GNU Classpath 0.97.1 (slightly modified import-statements so it compiles in this small example). I deleted most directories in workspace/.metadata/.plugins/ to reduce the filesize, and only included those directories that are needed to reproduce the bug on my machine. To reproduce the bug: 1) uncompress the attachment --> will create a directory "workspace" 2) Start a clean Eclipse 3.4M7 (I20080502-0100) and choose the workspace from (1) 3) Clean the project "test" --> There is an error on line 0 in TreeMap.java Opening the same workspace in Eclipse 3.4M6a (I20080409-1425) and cleaning the project does not reproduce the error. Opening the workspace again in 3.4M7 and cleaning the project generates the error again. Quitting Eclipse, deleting workspace/.metadata/.plugins/org.eclipse.core.runtime, launching 3.4M7 and cleaning the project solves the problem. So I think there must be some setting in workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/ that triggers the error, but I haven't found out yet which one it is...
Ok, I'll try to reproduce and make a small compiler regression test out of it. Thanks for your time.
Reproduced using your workspace. I could not however reproduce it using a new workspace and importing your test project in it.
It has to do with the compiler settings. If I restore default settings for your workspace, I can no longer reproduce the failure. I'll try to extract a small test case.
You need to check for unnecessary cast.
Created attachment 98650 [details] Regression test
I can confirm that setting the compiler option "Unnecessary cast or 'instanceof' operation" (in Preferences > Java > Compiler > Errors/Warnings) to "Ignore" gets rid of the error message, but setting it to "Warning" generates it again. Thanks for figuring this out. This solves for me the problem temporarily.
Created attachment 98764 [details] Proposed patch
Added GenericTypeTest#test1314. Released for 3.4RC1. Fixed
+1 for 3.4RC1
Verified for 3.4RC1 using I20080510-2000