Skip to content

Commit

Permalink
rpc: make empty Subject static final field
Browse files Browse the repository at this point in the history
As it never changes

Acked-by: Lea Morschel
Acked-by: Paul Millar
Target: master
  • Loading branch information
kofemann committed Sep 16, 2022
1 parent 755944a commit 4e98f79
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ public class RpcAuthTypeNone implements RpcAuth, XdrAble {
private final int _type = RpcAuthType.NONE;
private byte[] body;
private RpcAuthVerifier _verifier = new RpcAuthVerifier(RpcAuthType.NONE, new byte[0]);
private final Subject _subject;

private static final Subject _subject;
static {
_subject = new Subject();
_subject.setReadOnly();
}

private final static Logger _log = LoggerFactory.getLogger(RpcAuthTypeNone.class);

Expand All @@ -43,8 +48,6 @@ public RpcAuthTypeNone() {

public RpcAuthTypeNone(byte[] body) {
this.body = body;
_subject = new Subject();
_subject.setReadOnly();
}

@Override
Expand Down

0 comments on commit 4e98f79

Please sign in to comment.