Please consider this enhancement to `test/jdk/java/awt/dnd/BadSerializationTest/BadSerializationTest.java`, which simplifies the process of manually generating serialized test data by using reflection to generate invalid instances of `DragGestureEvent` and `DragGestureRecognizer`, instead of relying on patching the constructors of those classes to disable validation checks.
This cleanup was proposed in the review for a possible fix for [JDK-8277817](https://bugs.openjdk.java.net/browse/JDK-8277817): https://git.openjdk.java.net/jdk/pull/6603#issuecomment-997054470 ------------- Commit messages: - 8280054: BadSerializationTest and DragGestureEvent/DragGestureRecognizer constructors Changes: https://git.openjdk.java.net/jdk/pull/7099/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7099&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8280054 Stats: 57 lines in 1 file changed: 25 ins; 11 del; 21 mod Patch: https://git.openjdk.java.net/jdk/pull/7099.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/7099/head:pull/7099 PR: https://git.openjdk.java.net/jdk/pull/7099