-
Bug
-
Resolution: Fixed
-
P3
-
18
Currently, there is a bug in ObjectInputStream.FieldValues.get(name, val).
public Object get(String name, Object val) {
int off = getFieldOffset(name, Object.class);
if (off >= 0) {
int objHandle = objHandles[off];
handles.markDependency(passHandle, objHandle);
return (handles.lookupException(objHandle) == null) ?
objValues[off] : null;
} else {
return val;
}
Here, a call to handles.lookupException is made, however rather than throwing the associated exception, the method simply returns null.
This is causing ClassNotFoundExceptions to be buried by the stack and the exception being thrown further up the stack by the caller of the method.
The method signature for FieldValues.get does not declare it throws ClassNotFoundException.
public Object get(String name, Object val) {
int off = getFieldOffset(name, Object.class);
if (off >= 0) {
int objHandle = objHandles[off];
handles.markDependency(passHandle, objHandle);
return (handles.lookupException(objHandle) == null) ?
objValues[off] : null;
} else {
return val;
}
Here, a call to handles.lookupException is made, however rather than throwing the associated exception, the method simply returns null.
This is causing ClassNotFoundExceptions to be buried by the stack and the exception being thrown further up the stack by the caller of the method.
The method signature for FieldValues.get does not declare it throws ClassNotFoundException.
- clones
-
JDK-8273660 ObjectInputStream.GetField.get returns null instead of handling ClassNotFoundException
-
- Closed
-
- csr for
-
JDK-8276742 ObjectInputStream.GetField.get(name, object) should throw ClassNotFoundException
-
- Closed
-
- duplicates
-
JDK-8285427 javax.security.auth.Subject.SecureSet.readObject() NPE hides other exception
-
- Closed
-
- relates to
-
JDK-8277817 java/awt/dnd/BadSerializationTest/BadSerializationTest.java failed: ClassNotFoundException: com.apple.laf.AquaImageFactory$SystemColorProxy
-
- Open
-
(1 links to)