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

incompatibility problem between JDK1.2beta4 and JDK1.1.6

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2
    • Resolution: Not an Issue
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5

      Description



      Name: dsC58869 Date: 05/27/98



      There is binary incompatibility problem between JDK1.2beta4G and
      JDK1.1.6.
      The JDK1.2beta4G could not execute class compiled by JDK1.1.6
      that contains inner public class with private constructor.
      It throws IllegalAccessError.


      ==== Here is the test demonstrating the bug ====
      public class TestInner {

          public class InnerClassPublic {
           public InnerClassPublic(){
           }
          }
          public class InnerClassPrivate {
           private InnerClassPrivate(){
           }
          }
          public TestInner () {
          }
          public static void main(String[] args){
           TestInner A = new TestInner();
           InnerClassPublic B = A.a();
           System.out.println("OKAY: InnerClassPublic created");
           InnerClassPrivate C = A.b();
              System.out.println("OKAY: InnerClassPrivate created");
          }
          public InnerClassPublic a() {
           return new InnerClassPublic();
          }
          public InnerClassPrivate b() {
           return new InnerClassPrivate();
          }
      }

      ==== Here is the output of the test ====

      ------- Under jdk1.1.6 -------
      (sda@spear@/home/sda/temp/tests)71%/set/java/jdk1.1.6/solaris/bin/java -fullversion
      java full version "JDK1.1.6N"
      (sda@spear@/home/sda/temp/tests)72%/set/java/jdk1.1.6/solaris/bin/javac TestInner.java
      (sda@spear@/home/sda/temp/tests)74%/set/java/jdk1.1.6/solaris/bin/java TestInner
      OKAY: InnerClassPublic created
      OKAY: InnerClassPrivate created

      (sda@spear@/home/sda/temp/tests)70%java -fullversion
      java full version "JDK-1.2beta4-G"
      (sda@spear@/home/sda/temp/tests)75%java TestInner
      OKAY: InnerClassPublic created
      Exception in thread "main" java.lang.IllegalAccessError: try to access method TestInner$InnerClassPrivate.<init>(LTestInner;)V from class TestInner
      at TestInner.b(Compiled Code)
      at TestInner.main(Compiled Code)


      ------- Under jdk1.2-beta4-G -------
      (sda@spear@/home/sda/temp/tests)104%java -fullversion
      java full version "JDK-1.2beta4-G"
      (sda@spear@/home/sda/temp/tests)105%javac TestInner.java
      (sda@spear@/home/sda/temp/tests)106%java TestInner
      OKAY: InnerClassPublic created
      OKAY: InnerClassPrivate created

      ======================================================================
       Justification:
      This is a compatibility-related bug

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

        Attachments

          Activity

            People

            • Assignee:
              wmaddoxsunw William Maddox (Inactive)
              Reporter:
              dsilaev Dmitri Silaev
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: