hyperskill / hs-test

A framework that simplifies testing educational projects for Hyperskill. It is built on top of JUnit.
31 stars 10 forks source link

System::setSecurityManager called by org.hyperskill.hstest.dynamic.SystemHandler #128

Closed vic0824 closed 2 years ago

vic0824 commented 2 years ago

Ominous warning raised by IntelliJIDEA Educational

Task :wrapper BUILD SUCCESSFUL in 2s 1 actionable task: 1 executed Task :Tic-Tac-Toe_with_AI1_-task:compileJava Task :Tic-Tac-Toe_with_AI_1-task:processResources NO-SOURCE Task :Tic-Tac-Toe_with_AI1_-task:classes Task :util:compileJava Task :util:processResources NO-SOURCE Task :util:classes Task :util:compileTestJava NO-SOURCE Task :util:processTestResources NO-SOURCE Task :util:testClasses UP-TO-DATE Task :Tic-Tac-Toe_with_AI1_-task:compileTestJava Task :Tic-Tac-Toe_with_AI_1-task:processTestResources NO-SOURCE Task :Tic-Tac-Toe_with_AI1_-task:testClasses Task :Tic-Tac-Toe_with_AI_1-task:test WARNING: A terminally deprecated method in java.lang.System has been called WARNING: System::setSecurityManager has been called by org.hyperskill.hstest.dynamic.SystemHandler (file:/C:/Users/vittorio.torroni/.gradle/caches/modules-2/files-2.1/com.github.hyperskill/hs-test/release-SNAPSHOT/9ba6b13f29957863e1a1165b4b8c99db1a1370ab/hs-test-release-SNAPSHOT.jar) WARNING: Please consider reporting this to the maintainers of org.hyperskill.hstest.dynamic.SystemHandler WARNING: System::setSecurityManager will be removed in a future release

BUILD SUCCESSFUL in 7s 4 actionable tasks: 4 executed

aaaaaa2493 commented 2 years ago

@vic0824 Hello. We're aware of this issue. It produces this warning starting from Java 17. Starting from Java 18 it will become an error instead of a warning, therefore hs-test will not use SecurityManager in Java 18 or above. It's an important part of hs-test so I think it should be enabled even with warning (so, in Java 17).

https://github.com/hyperskill/hs-test/blob/e4a6d2984e9689993cd62e3f473106c068d88a61/src/main/java/org/hyperskill/hstest/dynamic/SystemHandler.java#L39-L42

https://github.com/hyperskill/hs-test/blob/e4a6d2984e9689993cd62e3f473106c068d88a61/src/main/java/org/hyperskill/hstest/common/JavaUtils.java#L45-L47