GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-1116

Stack Overflow while reorganizing Groovy classes

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.5.0Release
    • Fix Version/s: 2.5.2.Release
    • Component/s: Refactoring
    • Labels:
      None
    • Environment:
      Fedora 14
      Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
      Eclipse 3.6.1
      Using Groovy 1.8
    • Number of attachments :
      0

      Description

      Refactoring:

      Class A exists
      Create class B
      Try to modify A by adding "extends B" --> Stack Overflow (also, on restart Eclipse complains about stack overflow)

      The Eclipse log follows (there are lots of other errors before but they are separated from this one by a few minutes, so assuming unrelated).

      !ENTRY org.eclipse.ui 4 0 2011-07-18 22:42:21.352
      !MESSAGE Unhandled event loop exception
      !STACK 0
      java.lang.StackOverflowError
      at java.lang.Character.toLowerCase(Character.java:4208)
      at java.lang.Character.toLowerCase(Character.java:4175)
      at java.beans.Introspector.decapitalize(Introspector.java:263)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.getPropertyName(VariableScopeVisitor.java:194)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:156)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      ......
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)

      !ENTRY org.eclipse.ui 4 4 2011-07-18 22:42:24.889
      !MESSAGE Save All Failed

      !ENTRY org.eclipse.ui 2 0 2011-07-18 22:42:24.890
      !MESSAGE Save All Failed
      !STACK 0
      java.lang.StackOverflowError
      at org.codehaus.groovy.ast.ClassNode.equals(ClassNode.java:762)
      at org.codehaus.groovy.ast.ClassNode.isDerivedFrom(ClassNode.java:981)
      at org.codehaus.groovy.ast.ClassNode.isScript(ClassNode.java:1202)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:147)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      ....
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)

      !ENTRY org.eclipse.core.jobs 4 2 2011-07-18 22:42:28.635
      !MESSAGE An internal error occurred during: "Building workspace".
      !STACK 0
      java.lang.StackOverflowError
      at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1056)
      at org.codehaus.groovy.ast.ClassNode.getSuperClass(ClassNode.java:1050)
      at org.codehaus.groovy.ast.ClassNode.isDerivedFrom(ClassNode.java:990)
      at org.codehaus.groovy.ast.ClassNode.isScript(ClassNode.java:1202)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:147)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      ....
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)

      !ENTRY org.eclipse.ui 4 4 2011-07-18 22:42:29.360
      !MESSAGE An internal error has occurred.
      !STACK 0
      org.eclipse.swt.SWTException: Widget is disposed
      at org.eclipse.swt.SWT.error(SWT.java:4083)
      at org.eclipse.swt.SWT.error(SWT.java:3998)
      at org.eclipse.swt.SWT.error(SWT.java:3969)
      at org.eclipse.swt.widgets.Widget.error(Widget.java:466)
      at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:403)
      ...

      !ENTRY org.eclipse.ui 4 0 2011-07-18 22:43:16.984
      !MESSAGE Unable to create editor ID org.codehaus.groovy.eclipse.editor.GroovyEditor: Editor could not be initialized.
      !STACK 0
      java.lang.StackOverflowError
      at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1056)
      at org.codehaus.groovy.ast.ClassNode.getSuperClass(ClassNode.java:1050)
      at org.codehaus.groovy.ast.ClassNode.isDerivedFrom(ClassNode.java:990)
      at org.codehaus.groovy.ast.ClassNode.isScript(ClassNode.java:1202)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:147)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      ....
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:179)
      at org.codehaus.groovy.classgen.VariableScopeVisitor.findClassMember(VariableScopeVisitor.java:177)

      !ENTRY org.eclipse.ui 4 0 2011-07-18 22:43:16.991
      !MESSAGE Error occurred during status handling
      !STACK 0
      java.lang.NullPointerException
      at org.eclipse.ui.internal.statushandlers.InternalDialog$7.widgetSelected(InternalDialog.java:970)
      at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
      at org.eclipse.swt.widgets.Widget.sendSelectionEvent(Widget.java:1396)
      at org.eclipse.swt.widgets.Link.gtk_button_release_event(Link.java:340)

        Issue Links

          Activity

          Hide
          David Tonhofer added a comment - - edited

          Addition:

          The problem may stem from this structure:

          Base Class:

          class DsMaps {
             ....
          }
          

          Derived class with inner Class:

          class DsMapForSmartAttr extends DsMaps {
          
              public static class DsMaps {
              }
          
              public static DsMaps getX() {
                 ....
              }
          }
          
          Show
          David Tonhofer added a comment - - edited Addition: The problem may stem from this structure: Base Class: class DsMaps { .... } Derived class with inner Class: class DsMapForSmartAttr extends DsMaps { public static class DsMaps { } public static DsMaps getX() { .... } }
          Hide
          Andrew Eisenberg added a comment -

          I have been trying to recreate the problem with some variant of the code that you have here. However, I cannot.

          This stack trace is usually an indication of GRECLIPSE-531. Do you remember the steps that you took to get problem? This would help me reproduce.

          Show
          Andrew Eisenberg added a comment - I have been trying to recreate the problem with some variant of the code that you have here. However, I cannot. This stack trace is usually an indication of GRECLIPSE-531 . Do you remember the steps that you took to get problem? This would help me reproduce.
          Hide
          David Tonhofer added a comment -

          Hi Andrew.

          I'm sorry to say I cannot reproduce it. Everything works fine so far for things like

          class A {
          
          }
          
          class B extends A {
          
              public static class A {
                  // This is the class referenced by the the *extends*
                  // Does that make sense?
              }
          
              public static A getA() {
                  return new A()
              }
              
          }
          

          I recall that the error came up while I was really messily redesigning the class hierarchy. But that's about it.

          Show
          David Tonhofer added a comment - Hi Andrew. I'm sorry to say I cannot reproduce it. Everything works fine so far for things like class A { } class B extends A { public static class A { // This is the class referenced by the the * extends * // Does that make sense? } public static A getA() { return new A() } } I recall that the error came up while I was really messily redesigning the class hierarchy. But that's about it.
          Hide
          Andrew Eisenberg added a comment -

          Thanks for getting back to me. I will close this issue. But, please reopen and attach the entire stack trace if you ever see this happen again.

          Show
          Andrew Eisenberg added a comment - Thanks for getting back to me. I will close this issue. But, please reopen and attach the entire stack trace if you ever see this happen again.

            People

            • Assignee:
              Andrew Eisenberg
              Reporter:
              David Tonhofer
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: