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

(1.1) ClassCircularityError is not arisen by jvm

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      Name: szC45993 Date: 03/12/98



      The JCK
      vm/constantpool/ClassInterf/ClassInterf011/ClassInterf01101/ClassInterf01101.html
      test shows that jdk1.1.6 (and others jdk1.1.x) jvm does not detect correctly
      the situation when "a class or interface could not be loaded because it
      would be its own superclass or superinterface" (2.16.2 Loading, p. 43,
      jvm spec). ClassCircularityError should be arisen in this case as it
      takes place for jdk1.2b3L.
      Short test below and LOG demonstrate these facts.

      ========================================== LOG:

      novo7% setenv CLASSPATH /export/ld32/sqe/harness_release/classes:.
      novo7% /export/ld14/java/dest/jdk1.2Z/solaris/bin/javac *.java
      Tst.java:4: interface interf2 is defined in intrclss2.java. Because it is used outside of its source file, it should be defined in a file called "interf2.java".
        static interf2 i2 = new intrclss2();
                          ^
      1 warning
      novo7% /export/ld14/java/dest/jdk1.2Z/solaris/bin/java javasoft.sqe.jasm.Main -d . interf2.jasm
      novo7% /export/ld14/java/dest/jdk1.1.6/solaris/bin/java -verify Intrmdt
      Can't find class Intrmdt
      novo7% /export/ld14/java/dest/jdk1.1.6/solaris/bin/java Intrmdt
      Can't find class Intrmdt
      novo7% /export/ld14/java/dest/jdk1.1.5/solaris/bin/java -verify Intrmdt
      Can't find class Intrmdt
      novo7% /export/ld14/java/dest/jdk1.1.4G/solaris/bin/java -verify Intrmdt
      Can't find class Intrmdt
      novo7% /export/ld14/java/dest/jdk1.1.3/solaris/bin/java -verify Intrmdt
      Can't find class Intrmdt
      novo7% /export/ld14/java/dest/jdk1.1.2/solaris/bin/java -verify Intrmdt
      Can't find class Intrmdt
      novo7% /export/ld14/java/dest/jdk1.1.1/solaris/bin/java -verify Intrmdt
      Can't find class Intrmdt
      novo7% /export/ld14/java/dest/jdk1.2Z/solaris/bin/java -verify Intrmdt
      Segmentation Fault (core dumped)
      novo7% /export/ld14/java/dest/jdk1.2b3L/solaris/bin/java -verify Intrmdt
      java.lang.ClassCircularityError: interf2
      novo7%
      ========================================== SOURCES:

      --------------------- Intrmdt.java
      import java.io.PrintStream;

      public class Intrmdt extends Tst{

        public int intrmdtprc(PrintStream out) {

      return super.tstprc(out);
        }
        public static void main(String argv[]) {
      System.out.println((new Intrmdt()).intrmdtprc(System.out));
        }
      }
      --------------------- Tst.java
      import java.io.PrintStream;

      public class Tst{
        static interf2 i2 = new intrclss2();

        public int tstprc(PrintStream out) {
      i2.mthd();
      return 2;
        }
      }
      --------------------- intrclss2.java
      interface interf2 {
        
      abstract int mthd();

      }

       
      public class intrclss2 implements interf2{
        
      public int mthd() {
      return 2;
      }

      }
      --------------------- interf2.jasm
      interface interf2 extends interf2{
      // ^^^^^^^ ^^^^^^^
      // ^^^^^^^ ^^^^^^^ ClassCircularityError !!!!!!
      // ^^^^^^^ ^^^^^^^
        
      public abstract Method "mthd":"()I";

      }
      ---------------------

      Hook 5(hook5): test

      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            zsssunw Zss Zss (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: