TisonKun opened a new pull request #7302: [FLINK-11156] [tests] Reconcile powermock with JDK 9 URL: https://github.com/apache/flink/pull/7302 …Test ## What is the purpose of the change The issue is caused because powermock hasn't fully supported JDK 9+ yet. Specifically, when we `@PrepareForTest` on a class(`ZooKeeperCompletedCheckpointStore`) has a static final field initialized by `Comparator#comparing`, it causes `IncompatibleClassChangeError`. We can fallback to use the previous syntax as a workaround. Given https://github.com/powermock/powermock/issues/901 the author of powermock said "Right now the project is in frozen state because I do not have enough time.", we'd better fix the issue different from waiting to bump version. Here we have to use powermock for hijacking the constructor of `ZooKeeperStateHandleStore`. An alternative for resolving this issue is get rid of powermock, I have tried but ended with adding a testing constructor of `ZooKeeperStateHandleStore`, which looks quite hack for me. It may be better to introduce a builder for classes depending on `powemock#whennew` so we can get rid of it. ## Brief change log - fallback the implementation to previous style as a workaround ## Verifying this change This pull request itself is the test. Run `mvn test -Pjava9 -DfailIfNoTests=false -Dcheckstyle.skip=true -Dtest=org.apache.flink.runtime.checkpoint.ZooKeeperCompletedCheckpointStoreMockitoTest` for testing locally. ## 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**) cc @GJL
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services