-
CSR
-
Resolution: Approved
-
P3
-
None
-
behavioral
-
minimal
-
The additional text describes existing behavior.
-
Java API
-
SE
Summary
Clarify the current behavior of java.io.ObjectInputStream
constructors in the case where the serial filter factory from ObjectInputFilter.Config.getSerialFilterFactory
may throw an exception.
Problem
The javadoc for ObjectInputStream
constructors describes calling the serial filter factory returned from ObjectInputFilter.Config.getSerialFilterFactory()
but does not describe the case where the factory may throw an exception.
Solution
Exceptions throw by the serial filter factory are thrown normally and cause the ObjectInputStream
constructor to terminate with the exception.
Specification
In both ObjectInputStream
constructors add the following after the description of the invocation of the serial filter factory.
@@ -384,6 +384,8 @@ public class ObjectInputStream
* <p>The constructor initializes the deserialization filter to the filter returned
- * by invoking the {@link Config#getSerialFilterFactory()} with {@code null} for the current filter
+ * by invoking the serial filter factory returned from {@link Config#getSerialFilterFactory()}
+ * with {@code null} for the current filter
* and the {@linkplain Config#getSerialFilter() static JVM-wide filter} for the requested filter.
+ * When the filter factory {@code apply} method is invoked it may throw a runtime exception
+ * preventing the {@code ObjectInputStream} from being constructed.
@@ -421,6 +423,8 @@ public class ObjectInputStream
* <p>The constructor initializes the deserialization filter to the filter returned
- * by invoking the {@link Config#getSerialFilterFactory()} with {@code null} for the current filter
+ * by invoking the serial filter factory returned from {@link Config#getSerialFilterFactory()}
+ * with {@code null} for the current filter
* and the {@linkplain Config#getSerialFilter() static JVM-wide filter} for the requested filter.
+ * When the filter factory {@code apply} method is invoked it may throw a runtime exception
+ * preventing the {@code ObjectInputStream} from being constructed.
- csr of
-
JDK-8278044 ObjectInputStream methods invoking the OIF.CFG.getSerialFilterFactory() silent about error cases.
-
- Resolved
-