New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#21: Delegate Security Manager #24
Conversation
mvn license:update-file-header
feature/23-Delegate_Security_Manager Conflicts: README.md src/main/java/org/itsallcode/junit/sysextensions/ExitGuard.java src/main/java/org/itsallcode/junit/sysextensions/security/ExitGuardSecurityManager.java src/test/java/org/itsallcode/junit/sysextensions/TestSystemExit.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor findings, idea for improvement.
|
||
public ExitGuardSecurityManager(final SecurityManager delegate) | ||
{ | ||
this.delegate = delegate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check if argument is null
and use a default SecurityManager with empty methods. Then you can avoid the null
checks when delegating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this, but I find the other option less invasive.
src/main/java/org/itsallcode/junit/sysextensions/security/ExitGuardSecurityManager.java
Show resolved
Hide resolved
.../java/org/itsallcode/junit/sysextensions/TestSystemExitReplacingExistingSecurityManager.java
Show resolved
Hide resolved
Co-authored-by: chπ <kaklakariada@chp1.net>
Closes #21.