Community
Participate
Working Groups
Eclipse 3.0 build 200307300800 I was pasting some code into an inner class (a listener) when I got the following stack overflow error. The code I was pasting in did not have the correct number of closing "}". !ENTRY org.eclipse.ui 4 0 Aug 11, 2003 10:31:03.460 !MESSAGE java.lang.StackOverflowError !STACK 0 java.lang.StackOverflowError at org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding.<init> (SourceTypeBinding.java:46) at org.eclipse.jdt.internal.compiler.lookup.NestedTypeBinding.<init> (NestedTypeBinding.java:23) at org.eclipse.jdt.internal.compiler.lookup.LocalTypeBinding.<init> (LocalTypeBinding.java:24) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.buildLocalType (ClassScope.java:143) at org.eclipse.jdt.internal.compiler.lookup.ClassScope.buildAnonymousTypeBinding (ClassScope.java:33) at org.eclipse.jdt.internal.compiler.lookup.BlockScope.addAnonymousType (BlockScope.java:77) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType (QualifiedAllocationExpression.java:362) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve (Expression.java:433) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatemen ts(AbstractMethodDeclaration.java:363) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements (MethodDeclaration.java:135) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve (AbstractMethodDeclaration.java:353) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve (TypeDeclaration.java:848) at org.eclipse.jdt.internal.compiler.ast.AnonymousLocalTypeDeclaration.resolve (AnonymousLocalTypeDeclaration.java:124) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType (QualifiedAllocationExpression.java:363) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve (Expression.java:433) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatemen ts(AbstractMethodDeclaration.java:363) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements (MethodDeclaration.java:135) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve (AbstractMethodDeclaration.java:353) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve (TypeDeclaration.java:848) at org.eclipse.jdt.internal.compiler.ast.AnonymousLocalTypeDeclaration.resolve (AnonymousLocalTypeDeclaration.java:124) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType (QualifiedAllocationExpression.java:363) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve (Expression.java:433) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatemen ts(AbstractMethodDeclaration.java:363) at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements (MethodDeclaration.java:135) at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve (AbstractMethodDeclaration.java:353) at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve (TypeDeclaration.java:848) at org.eclipse.jdt.internal.compiler.ast.AnonymousLocalTypeDeclaration.resolve (AnonymousLocalTypeDeclaration.java:124) at org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression.resolveType (QualifiedAllocationExpression.java:363) at org.eclipse.jdt.internal.compiler.ast.Expression.resolve (Expression.java:433) ...
Could you please provide the whole test case? Thanks.
I will have to try and recreate it the steps. After the StackOverflow error, eclipse was not behaving correctly and had to be restarted.
I had the class Browser.java (see attached). I selected the following: --start selection here webSite.addEventListener (OleWebBrowser.ProgressChange, new OleListener() { public void handleEvent(OleEvent event) -- end selection here (before "}") Then, I hit Ctrl+X, CTRL+Z, CTRL+S a few times and the error happened. I can't make it happen every time but if I play with the CTRL+X, CTRL+Z, CTRL+S, eventually it happens. I will also attach my preferences.
Created attachment 5714 [details] java file Browser.java
Created attachment 5715 [details] Veronika's preferences Veronika's preferences
I think this has something to do with the recovery.
Need to be backported to 2.1 once addressed.
Simple test case 1) create X.java package p; public class X{ public void foo() { new Y() { public void bar() { switch (zzz){ case 1 : }; } new Z() { public void to<cursor>to() { } }); }); } } 2) do ctrl + space at cursor location
Inside RecoveredType [public RecoveredElement add(TypeDeclaration memberTypeDeclaration, int bracketBalanceValue) { ... return lastMethod.add(typeDeclaration, bracketBalanceValue); ... }] must be [public RecoveredElement add(TypeDeclaration memberTypeDeclaration, int bracketBalanceValue) { ... return lastMethod.add(memberTypeDeclaration, bracketBalanceValue); ... }] Fixed and regression test added (CompletionParserTest2#test0138()) in 3.0
*** Bug 57067 has been marked as a duplicate of this bug. ***
*** Bug 38098 has been marked as a duplicate of this bug. ***
Backported and regression test added (CompletionParserTest2#test0130()) in 2.1
Verified in 200405180816