Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4035013

Cyclic scoping source causes javac exception.

XMLWordPrintable

    • generic
    • generic

      The following code:

      public class CyclicScoping {
        class Inner1 extends Inner2 {}
        class Inner2 {
          class Inner3 extends Inner1 {}
        }
      }

      causes

      java.lang.ClassCastException: sun.tools.tree.LocalField
              at sun.tools.javac.SourceField.createArgumentFields(SourceField.java)
              at sun.tools.javac.SourceField.resolveTypeStructure(SourceField.java)
              at sun.tools.javac.SourceClass.resolveTypeStructure(SourceClass.java)
              at sun.tools.javac.SourceField.resolveTypeStructure(SourceField.java)
              at sun.tools.javac.SourceClass.resolveTypeStructure(SourceClass.java)
              at sun.tools.javac.SourceClass.basicCheck(SourceClass.java)
              at sun.tools.java.ClassDefinition.basicCheck(ClassDefinition.java)
              at sun.tools.javac.SourceClass.basicCheck(SourceClass.java)
              at sun.tools.java.ClassDeclaration.getClassDefinition(ClassDeclaration.java)
              at sun.tools.javac.Main.compile(Main.java)
              at sun.tools.javac.Main.main(Main.java)
      error: An exception has occurred in the compiler; please file a bug report (###@###.###).
      1 error

            wmaddoxsunw William Maddox (Inactive)
            sishidasunw Shoji Ishida (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: