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

Cyclic inheritance may cause internal error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.1
    • tools
    • None
    • sparc
    • solaris_2.5



      Name: saC57035 Date: 12/27/96


      In some cases (I didn't find out the exact condition) internal error
      occurs instead of reporting on cyclic inheritance.

      Here is the example demonstrating the bug:

      ---- StubMenuComponentPeer.java ----------------------
      package javasoft.sqe.tests.api.java.awt.Toolkit;

      import java.awt.*;
      import java.awt.peer.*;
      import java.util.Vector;

      public class StubMenuComponentPeer extends StubMenuComponentPeer implements MenuItemPeer {

        private Vector log;

        public StubMenuComponentPeer (Vector log) {
         this.log = log;
        }

        void dispose() {
         log.addElement("StubMenuComponentPeer dispose");
        }
      }
      -- The output ----------------
      java.lang.StackOverflowError
      at sun.tools.java.ClassDeclaration.getClassDefinition(ClassDeclaration.java)
      at sun.tools.java.ClassDefinition.getInnerClass(ClassDefinition.java)
      at sun.tools.java.ClassDefinition.getInnerClass(ClassDefinition.java)
      <.......................>
      at sun.tools.java.ClassDefinition.getInnerClass(ClassDefinition.java)
      at sun.tools.java.ClassDefinition.getInnerClass(ClassDefinition.java)
      at sun.tools.java.ClassDefinition.resolveName(ClassDefinition.java)
      at sun.tools.java.Environment.resolveNames(Environment.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.ClassDeclaration.getClassDefinition(ClassDeclaration.java)
      at sun.tools.javac.Main.compile(Main.java)
      at sun.tools.javac.Main.main(Main.java)
      error: An error has occurred in the compiler; please file a bug report (###@###.###).
      1 error
      ------------------------------

      ======================================================================
      allan.jacobs@Eng 1997-03-05
      JCK test clss04905 has this problem. For that test, the problem goes
      away when the package statement is removed.

            wmaddoxsunw William Maddox (Inactive)
            savzan Stanislav Avzan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: