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

H regress. Externalizable.isAssignable(array of String) incorrectly returns true

XMLWordPrintable

    • 1.2fcs
    • generic, sparc
    • solaris_2.5, solaris_2.6
    • Verified

      This regression was introduced in the JDK1.2fcs-H build. It causes
      "appletviewer http://schedroom.central/schedroom.html" to fail with
      a serialization failure that reports that an array of java.lang.String has incompatibly been switched from Serializable to Externalizable.
      The descriptor in the stream states the array is Serializable and
      the JVM 1.2fcsH runtime is incorrectly calculating that the
      array of java.lang.String is Externalizable.

      A small test program demonstrates that the following is failing
      in the H build.

      The call to
      Externalizable.class.isAssignableFrom(Class.forName("[Ljava.lang.String;")
      is incorrectly returning TRUE in the H build. It should always be false and was
      false in the G build.

      Test program run against G and H build to demonstrate the regression.
      (JIT was shut off to rule that out.)

      joef/scarry>/js/files/JDK1.2FCS-H/solaris/bin/java Array
      Warning: JIT compiler "none" not found. Will use interpreter.
      name=[Ljava.lang.String;
      Class [Ljava.lang.String; isAssignableTo(Serializable) = true
      Class [Ljava.lang.String; isAssignableTo(Externalizable) = true /* REGRESSION*/

      joef/scarry>/js/files/JDK1.2FCS-G/solaris/bin/java Array
      Warning: JIT compiler "none" not found. Will use interpreter.
      name=[Ljava.lang.String;
      Class [Ljava.lang.String; isAssignableTo(Serializable) = true
      Class [Ljava.lang.String; isAssignableTo(Externalizable) = false


      Test program:

      import java.io.*;
      public class Array {

          public static void main(String args[]) {
      String[] array = new String[2];
      Class cl = array.getClass();
      System.out.println("name=" + cl.getName());
      System.out.println("Class " + cl.getName() + " isAssignableTo(Serializable) = " + Serializable.class.isAssignableFrom(cl));

      System.out.println("Class " + cl.getName() + " isAssignableTo(Externalizable) = " + Externalizable.class.isAssignableFrom(cl));
          }
      };


      Schedroom failure:

      joef/scarry>/js/files/JDK1.2FCS-H/solaris/bin/appletviewer http://schedroom.central/schedroom.html
      Warning: JIT compiler "none" not found. Will use interpreter.
      java.rmi.UnmarshalException: Error unmarshaling return; nested exception is:
              java.io.InvalidClassException: [Ljava.lang.String;; Serializable is incompatible with Externalizable
      java.io.InvalidClassException: [Ljava.lang.String;; Serializable is incompatible with Externalizable
              at java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:458)
              at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:482)
              at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:776)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:227)
              at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:793)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:352)
              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:227)
              at sunir.schedroom.server.SrServer_Stub.getAllTimeZone(SrServer_Stub.java:271)
              at sunir.schedroom.client.Main.<init>(Main.java:112)
              at sunir.schedroom.client.SrLogin.actionPerformed(SrLogin.java:145)
              at java.awt.TextField.processActionEvent(TextField.java:470)
              at java.awt.TextField.processEvent(TextField.java:443)
              at java.awt.Component.dispatchEventImpl(Component.java:2364)
              at java.awt.Component.dispatchEvent(Component.java:2275)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:258)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:68)

            bgomessunw Benedict Gomes (Inactive)
            jfialli Joe Fialli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: