Fix various unit test failures related to powermock running in JDK 11 #1400
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Errors like:
[ERROR] initializationError(com.pinterest.secor.io.FileReaderWriterFactoryTest) Time elapsed: 0 s <<< ERROR!
java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by org.powermock.core.classloader.MockClassLoader @5c448ef cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl
The errors only occur in JDK 9 and above, powermock (and its dependent jboss.javassist) has issues on JDK 9 and above, see https://stackoverflow.com/questions/50456726/mockclassloader-cannot-access-jdk-internal-reflect-superclass-jdk-internal-refle
Upgraded the powermock to latest version and used techniques like @PowerMockIgnore to defer un-related class's classloading to the system default classloader (instead of the powermock's classloader).
The other issue is mock's anyString() seems not matching argument Null, changed some unit tests to pass in a non-null argument.