Skip to content

Commit 4e98f79

Browse files
committed
rpc: make empty Subject static final field
As it never changes Acked-by: Lea Morschel Acked-by: Paul Millar Target: master
1 parent 755944a commit 4e98f79

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

oncrpc4j-core/src/main/java/org/dcache/oncrpc4j/rpc/RpcAuthTypeNone.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ public class RpcAuthTypeNone implements RpcAuth, XdrAble {
3333
private final int _type = RpcAuthType.NONE;
3434
private byte[] body;
3535
private RpcAuthVerifier _verifier = new RpcAuthVerifier(RpcAuthType.NONE, new byte[0]);
36-
private final Subject _subject;
36+
37+
private static final Subject _subject;
38+
static {
39+
_subject = new Subject();
40+
_subject.setReadOnly();
41+
}
3742

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

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

4449
public RpcAuthTypeNone(byte[] body) {
4550
this.body = body;
46-
_subject = new Subject();
47-
_subject.setReadOnly();
4851
}
4952

5053
@Override

0 commit comments

Comments
 (0)