Skip to content

[BUG] SecurityManager is deprecated for removal and spotbugs complains about it during build #7079

@Azhrei

Description

@Azhrei

Describe the bug
There are ~36 situations where a SecurityManager is being constructed in the current code base. This class is deprecated and will likely go away very soon (it was deprecated prior to Java 17, then warnings started being issued, and it's likely to go away no later than 24).

To Reproduce
Attempt to run ./gradlew spotbugs and watch the error messages scroll. 🙂

Expected behavior
The build should finish without errors.

Desktop (please complete the following information):

  • OS: Any
  • Version Any

Additional context
All references to the SecurityManager are from the SystemExitInterloper (or is it Intercepter?) class. This class is a kludge to allow a test to call argparse4j.parseArgsOrFail() and for the error to be caught.

However, the latest argparse4j has a method named parseArgs() that throws an IllegalArgumentException instead. This is how the tests should be written.

(I have made proof of concept changes to Main, CommandLine, and CommandLineTest, but I have not pushed them to my repo yet and won't be able to do so for another 24 hours or so. It's at https://github.com/Azhrei/pcgen under the sm-fix2 branch.)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions