-
Enhancement
-
Resolution: Unresolved
-
P4
-
17
-
None
Currently java/awt/dnd/BadSerializationTest tests invalid serialized DragGestureEvent/DragGestureRecognizer instances by relying on checked in serialized data. The serialized data has to be generated by manually patching the constructors of DragGestureEvent/DragGestureRecognizer to disable validation, and then generating and checking in the serialized data.
See also the implementation comment here: https://github.com/openjdk/jdk/blob/fef8f2d30004ea75c663752ae6c61b214fb8abc8/test/jdk/java/awt/dnd/BadSerializationTest/BadSerializationTest.java#L95-L96
As suggested in https://git.openjdk.java.net/jdk/pull/6603#issuecomment-997054470, it is possible to generated the serialized data by using reflection to create the invalid DragGestureEvent/DragGestureRecognizer, instead of relying on patching their constructors.
Using reflection makes regenerating the test data more repeatable (since it doesn't rely on recreating a the patch to disable constructor validation and building a patched JDK), and could enable generating the serialized data when the test executes instead of relying on checking it in (see discussion in https://git.openjdk.java.net/jdk/pull/6603).
See also the implementation comment here: https://github.com/openjdk/jdk/blob/fef8f2d30004ea75c663752ae6c61b214fb8abc8/test/jdk/java/awt/dnd/BadSerializationTest/BadSerializationTest.java#L95-L96
As suggested in https://git.openjdk.java.net/jdk/pull/6603#issuecomment-997054470, it is possible to generated the serialized data by using reflection to create the invalid DragGestureEvent/DragGestureRecognizer, instead of relying on patching their constructors.
Using reflection makes regenerating the test data more repeatable (since it doesn't rely on recreating a the patch to disable constructor validation and building a patched JDK), and could enable generating the serialized data when the test executes instead of relying on checking it in (see discussion in https://git.openjdk.java.net/jdk/pull/6603).
- relates to
-
JDK-8277817 java/awt/dnd/BadSerializationTest/BadSerializationTest.java failed: ClassNotFoundException: com.apple.laf.AquaImageFactory$SystemColorProxy
-
- Open
-
- links to
-
Review openjdk/jdk/7099