-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
8, 11, 17
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 cannot be changed. However, given that FieldValues implements the GetField interface, the GetField.get(name, value) method throws an IOException.
The CNFE exception could be wrapped in an IOException and get thrown here, rather than incorrectly further up the stack.
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 cannot be changed. However, given that FieldValues implements the GetField interface, the GetField.get(name, value) method throws an IOException.
The CNFE exception could be wrapped in an IOException and get thrown here, rather than incorrectly further up the stack.
- csr for
-
JDK-8275652 ObjectInputStream.GetField.get returns null instead of handling ClassNotFoundException
-
- Closed
-
- duplicates
-
JDK-8268380 ClassNotFoundException not propagated to stack trace during deserialization
-
- Closed
-
-
JDK-8267031 8u261 Oracle <-> IBM JDK Inconsistent vector internals
-
- Closed
-
- is cloned by
-
JDK-8277093 Vector should throw ClassNotFoundException for a missing class of an element
-
- Resolved
-
-
JDK-8276665 ObjectInputStream.GetField.get(name, object) should throw ClassNotFoundException
-
- Closed
-
- links to
-
Review openjdk/jdk/6053
(1 links to)