stefanbirkner / system-rules

A collection of JUnit rules for testing code which uses java.lang.System.
http://stefanbirkner.github.io/system-rules
Other
546 stars 71 forks source link

[java10] removal of SecurityManager.getInCheck() #65

Open dfa1 opened 6 years ago

dfa1 commented 6 years ago

I tried to compile this project with JDK10 and maven 3.5.0:

[ERROR] /Users/dfa/projects/system-rules/src/main/java/org/junit/contrib/java/lang/system/internal/NoExitSecurityManager.java:[39,9] method does not override or implement a method from a supertype
[ERROR] /Users/dfa/projects/system-rules/src/main/java/org/junit/contrib/java/lang/system/internal/NoExitSecurityManager.java:[42,51] cannot find symbol
[ERROR]   symbol:   method getInCheck()
[ERROR]   location: variable originalSecurityManager of type java.lang.SecurityManager

Looks like this method has been removed between java9 and java10: https://bugs.openjdk.java.net/browse/JDK-8189750

dfa1 commented 6 years ago

This fix could be to just remove the usage ofgetInCheck().

stefanbirkner commented 6 years ago

Thanks for reporting the problem.

That's "only" a compilation problem. It will not be fixed because System Rules can be used with JDK 10 but not be build by JDK 10. I extend the README respectively.