Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1919

Infinite recursion while getting field from POJC

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1-beta-1
    • 1.1-rc-3
    • None
    • None
    • Windows XP, Java 1.6.0_02, recent groovy from svn

    Description

      In "Helper.java," put:

      public class Helper {
      public static final int num = 44;
      }

      run "javac Helper.java"

      In "bug.groovy," put:

      import Helper

      new int[Helper.num]

      run "groovy bug.groovy." I get: Caught: java.lang.StackOverflowError. The call stack is:

      ResolveVisitor.resolveAliasFromModule(ClassNode) line: 415
      ResolveVisitor.resolveFromModule(ClassNode, boolean) line: 512
      ResolveVisitor.resolve(ClassNode, boolean, boolean, boolean) line: 225

      In particular:

      This function:
      private boolean resolve(ClassNode type)

      { return resolve(type,true,true,true); }

      is called with a ClassNode where name="Helper.num", superClass = java.lang.Object, and everything else is null. Is ClassNode supposed to represent a class? If so, it's probably an error that the name is "Helper.num" and not, say, Helper.

      Attachments

        Activity

          People

            Unassigned Unassigned
            mcspanky Martin C. Martin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: