Although the fix in merlin for 4171142 ("Deserialization fails for Class object
of primitive type") allows ObjectInputStream.resolveClass() to properly
resolve primitive class types, MarshalInputStream.resolveClass() still fails
to resolve them, meaning that primitive Class objects cannot be sent over
RMI calls or stored in MarshalledObjects. The following simple test case
demonstrates the problem:
public class Foo {
public static void main(String[] args) throws Exception {
new java.rmi.MarshalledObject(int.class).get();
}
}
Either MarshalInputStream.resolveClass() should be modified to handle
primitive class cases, or else ObjectInputStream should be changed to
check for primitive class resolution failures if resolveClass() throws
a ClassNotFoundException.
of primitive type") allows ObjectInputStream.resolveClass() to properly
resolve primitive class types, MarshalInputStream.resolveClass() still fails
to resolve them, meaning that primitive Class objects cannot be sent over
RMI calls or stored in MarshalledObjects. The following simple test case
demonstrates the problem:
public class Foo {
public static void main(String[] args) throws Exception {
new java.rmi.MarshalledObject(int.class).get();
}
}
Either MarshalInputStream.resolveClass() should be modified to handle
primitive class cases, or else ObjectInputStream should be changed to
check for primitive class resolution failures if resolveClass() throws
a ClassNotFoundException.
- relates to
-
JDK-4171142 Deserialization fails for Class object of primitive type
-
- Closed
-