UseCase : setting property `jdk.serialFilter` as invalid and invoking Config.CreateFilter() twice.
Expected behavior : java.lang.ExceptionInInitializerError supposed to be thrown
Actual behavior : first invocation throws the java.lang.ExceptionInInitializerError and the second invocation throws java.lang.NoClassDefFoundError.
The java.lang.NoClassDefFoundError is unspecified anywhere in this context.
IMO we need to mention the possibility of java.lang.NoClassDefFoundError in the spec.
Sample Code :
========
Run the following with -Djdk.serialFilter=maxrefs=-123
Assert.assertThrows(() -> Config.createFilter("maxdepth=2;maxrefs=5"), ExceptionInInitializerError.class );
Assert.assertThrows(() -> Config.createFilter("maxdepth=2;maxrefs=5"), ExceptionInInitializerError.class );
And the second call would generate: Failed. None of the expected [java.lang.ExceptionInInitializerError] was thrown. java.lang.NoClassDefFoundError was thrown instead
Expected behavior : java.lang.ExceptionInInitializerError supposed to be thrown
Actual behavior : first invocation throws the java.lang.ExceptionInInitializerError and the second invocation throws java.lang.NoClassDefFoundError.
The java.lang.NoClassDefFoundError is unspecified anywhere in this context.
IMO we need to mention the possibility of java.lang.NoClassDefFoundError in the spec.
Sample Code :
========
Run the following with -Djdk.serialFilter=maxrefs=-123
Assert.assertThrows(() -> Config.createFilter("maxdepth=2;maxrefs=5"), ExceptionInInitializerError.class );
Assert.assertThrows(() -> Config.createFilter("maxdepth=2;maxrefs=5"), ExceptionInInitializerError.class );
And the second call would generate: Failed. None of the expected [java.lang.ExceptionInInitializerError] was thrown. java.lang.NoClassDefFoundError was thrown instead
- csr for
-
JDK-8277571 Document that setting an invalid property `jdk.serialFilter` disables deserialization
- Closed
- duplicates
-
JDK-8278087 Deserialization filter and filter factory property error reporting under specified
- Closed
- relates to
-
JDK-8276610 Document setting property `jdk.serialFilter` to an invalid value throws `ExceptionInInitializerError`
- Closed
- links to
-
Review openjdk/jdk/6508