JDK-4370704 : Merlin: Font instances can not be de-serialized with JDK 1.4
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2000-09-13
  • Updated: 2000-09-13
  • Resolved: 2000-09-13
Related Reports
Duplicate :  
Description
ingrid.yao@Eng 2000-09-13

J2SE Version:
+++++++++++++
java version "1.4.0beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0beta-b28)
Java HotSpot(TM) Client VM (build B22, mixed mode)

Does this problem occur on J2SE 1.3? 
+++++++++++++++++++++++++++++++++++
NO

Operating System Configuration Information:
+++++++++++++++++++++++++++++++++++++++++++
Windows NT 4 SP 4

Hardware Configuration Information (be specific): 
++++++++++++++++++++++++++++++++++++++++++++++++
PII 400 Mhz - 256 MB -
Graphics board I740


Bug Description:

Font instances serialized using JRE 1.3 cannot be de-serialized with 
version 1.4. Same as the other way that serialized using JRE 1.4 cannot
be de-serialize with version 1.3. The following exception is raised:

java.io.InvalidClassException:
java.text.AttributedCharacterIterator$Attribute; Local cl
desc serialVersionUID=-9142742483513960612 local class
serialVersionUID=-151447121437679
        at
java.io.ObjectStreamClass.validateLocalClass(ObjectStreamClass.java:523)
        at java.io.ObjectStreamClass.setClass(ObjectStreamClass.java:567)
        at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:936)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at
java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java:940)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at
java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1186)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at java.util.Hashtable.readObject(Hashtable.java:791)
        at java.lang.reflect.Method.invoke(Native Method)
        at
java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2213)
        at
java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1410)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
        at
java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:2262)
        at
java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:519)
        at java.awt.Font.readObject(Font.java:954)
        at java.lang.reflect.Method.invoke(Native Method)
        at
java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2213)
        at
java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1410)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
        at FontSerRead.main(FontSerRead.java:11)


Steps to Reproduce (be specific):a
+++++++++++++++++++++++++++++++++

1> /usr/local/java/jdk1.3/win32/bin/javac FontWrite.java
2> /usr/local/java/jdk1.3/win32/bin/javac FontRead.java
3> /usr/local/java/jdk1.3/win32/bin/java FontWrite
4> /usr/local/java/jdk1.3/win32/bin/java FontRead  <--- work fine
5> /usr/local/java/jdk1.4/win32/bin/java FontRead  <--- exception throw

Comments
EVALUATION The submitted code basically creates a new font, Font font = new Font("Arial",Font.PLAIN,10); and serializes and deserializes it. My first guess is that this may have been caused by changes to Font that 2D may have made. I'll assign it to classes_2D for further evaluation. eric.hawkes@eng 2000-09-13 it looks like the reason why having problem to deserialize Font instances in Merlin is due that calculation of serialVersionUID changed from 1.3 to 1.4. duplicate bug#4365406. ingrid.yao@Eng 2000-09-13
2000-09-13