Community
Participate
Working Groups
I'm having this exception, with 3.1RC1: !ENTRY org.eclipse.core.runtime 4 2 2005-05-31 08:54:30.119 !MESSAGE An internal error occurred during: "Building workspace". !STACK 0 java.lang.StackOverflowError at org.eclipse.jdt.internal.compiler.lookup.TypeBinding.isEquivalentTo(TypeBinding.java:177) at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.isCompatibleWith(ReferenceBinding.java:675) at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.isCompatibleWith(ReferenceBinding.java:687) at org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding.isCompatibleWith(ReferenceBinding.java:687) ... The project being compiled makes heavy use of generic types, including type bounds, wildcards etc. and looking at ReferenceBinding.isCompatibleWith() the problem seems to be related to generic types. Unfortunately the error logs don't include any information about the source elements that caused the problem (not even source file). After (and only if) this error happens, if I try to exit Eclipse or wait until the next periodic workspace save, another error happens, but I guess this second error is a side effect of the former: !ENTRY org.eclipse.ui.ide 4 1 2005-05-31 08:54:36.463 !MESSAGE Problems occurred while trying to save the state of the workbench. !SUBENTRY 1 org.eclipse.core.resources 4 568 2005-05-31 08:54:36.463 !MESSAGE Could not write metadata for: /PSS_30. !STACK 0 java.io.UTFDataFormatException: encoded string too long: 109612 bytes at java.io.DataOutputStream.writeUTF(DataOutputStream.java:347) at java.io.DataOutputStream.writeUTF(DataOutputStream.java:306) at org.eclipse.core.internal.resources.MarkerWriter.write(MarkerWriter.java:181) ... Problem didn't happen with M7/RC0, and doesn't happen with many other projects that I have, including others that use lots of generic types too.
Please provide steps to reproduce, then reopen. Normally, an additional problem should have been added on line 1 of offending file; associated to a message containing the stack trace you got in the log. This should help you narrow the problem.
Created attachment 22056 [details] Test workspace
Oops, your're right, the compiler creates a problem marker pointing to the source file that caused the error. So I managed to produce a minimal workspace (attached) that shows the problem. Steps to reproduce: 1) Fresh install of Eclipse RC1 (just Platform + JDT) 2) Open this workspace 3) CTRL+B to build --> produces the compiler error 4) Open the file PSClass.java --> produces another related error, "Requesting Java AST from selection". Then you have to close the editor, otherwise this error cycles in a loop if you close the dialog.
The second stack trace indicates that an IMarker had a message of more than 65,536 bytes in length. Perhaps the stack trace of the StackOverflowError is being added to the marker message or another marker property, causing a very long message?
I have entered bug 97608 against platform resources to handle the marker save failure (second stack).
Reproduced using build N20050608-0010 on workspace provided in comment 2. You just need ot open PSClass.java and click everywhere in the code or move the cursor...
Simpler testcase: public class X<E> { X<? super E> parent; X<? super E> current; void foo() { current = current.parent; } }
Our protection for circular captures didn't perform for lower bounds. Fixed, added GenericTypeTest#test
Verified for 3.1 RC2 using build N20050609-0010 + JDT/Core HEAD
Verified with I20050610-0010