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

inner class is incorrectly verified when requesting modifiers of outer class

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.2.0
    • 1.2.0
    • hotspot
    • None
    • 1.2beta4
    • generic, sparc
    • solaris_2.5, solaris_2.5.1
    • Not verified

      Serialization fails to serialize java.util.Vector due to following bug.

      There is a class verification bug when a class contains a
      private or package accessible inner class. The inner class
      is being verified instead of the class that is being
      used to request the modifiers from.

      The following test case run against JDK1.2Beta4-A confirms this.
      (I shut the JIT off just to remove a variable.)

      public class Inner {
          private class Itr {
      int i;
          };

          public static void main(String argv[]) throws Exception {
      System.out.println("public class Inner.getModifiers() " +
      Inner.class.getModifiers());
          }

      };

      Output:

      joef/scarry>java Inner
      Warning: JIT compiler "none" not found. Will use interpreter.
      java.lang.IllegalAccessError: try to access class Inner$Itr from class java/lang/Class
              at java.lang.Class.getModifiers(Native Method)
              at Inner.main(Inner.java:8)

            apalanissunw Anand Palaniswamy (Inactive)
            jfialli Joe Fialli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: