StephanEwen opened a new pull request #9251: [FLINK-13451][tests] Remove use of Unsafe.defineClass() from CommonTestUtils URL: https://github.com/apache/flink/pull/9251 ## What is the purpose of the change The method `Unsafe.defineClass()` is removed in Java 11. To support Java 11, we rework the method `CommonTestUtils.createClassNotInClassPath()` to use a different mechanism. This commit now writes the class byte code out to a temporary file and create a new URLClassLoader that loads the class from that file. The solution is not a complete drop-in replacement, because it cannot add the class to an existing class loader, but can only create a new pair of (classloader & new-class-in-that-classloader). Because of that, the commit also adjusts the existing tests to work with that new mechanism. ## Brief change log - Change `CommonTestUtils`: `createObjectForClassNotInClassPath()` ==> `createObjectFromNewClassLoader()` - Adjust existing tests ## Verifying this change There are two unit tests that validate the method of the new test utility. Aside from that, this change is a refactoring of existing tests and thus needs no additional tests. ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): **no** - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: **no** - The serializers: **no** - The runtime per-record code paths (performance sensitive): **no** - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: **no** - The S3 file system connector: **no** ## Documentation - Does this pull request introduce a new feature? **no** - If yes, how is the feature documented? **not applicable**
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
