Skip to content

Commit

Permalink
Refactor.
Browse files Browse the repository at this point in the history
It is more verbose but it stops Eclipse complaining about a possible NPE.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1800202 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jun 28, 2017
1 parent 93ae8bd commit 77b1a50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions java/org/apache/juli/FileHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,13 @@ public class FileHandler extends Handler {

{
SecurityManager s = System.getSecurityManager();
this.isSecurityEnabled = s != null;
this.group = isSecurityEnabled ? s.getThreadGroup()
: Thread.currentThread().getThreadGroup();
if (s == null) {
this.isSecurityEnabled = false;
this.group = Thread.currentThread().getThreadGroup();
} else {
this.isSecurityEnabled = true;
this.group = s.getThreadGroup();
}
}

@Override
Expand Down

0 comments on commit 77b1a50

Please sign in to comment.