Skip to content

Commit c393ee8

Browse files
committed
8276632: Use blessed modifier order in security-libs code
Reviewed-by: mullan
1 parent 7023b3f commit c393ee8

15 files changed

Lines changed: 153 additions & 153 deletions

File tree

src/java.security.jgss/share/classes/sun/security/jgss/ProviderList.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -160,7 +160,7 @@ private Oid getOidFromMechFactoryProperty(String prop)
160160
}
161161

162162
// So the existing code do not have to be changed
163-
synchronized public MechanismFactory getMechFactory(Oid mechOid)
163+
public synchronized MechanismFactory getMechFactory(Oid mechOid)
164164
throws GSSException {
165165
if (mechOid == null) mechOid = ProviderList.DEFAULT_MECH_OID;
166166
return getMechFactory(mechOid, null);
@@ -177,7 +177,7 @@ synchronized public MechanismFactory getMechFactory(Oid mechOid)
177177
* support the desired mechanism, or when no provider supports
178178
* the desired mechanism.
179179
*/
180-
synchronized public MechanismFactory getMechFactory(Oid mechOid,
180+
public synchronized MechanismFactory getMechFactory(Oid mechOid,
181181
Provider p)
182182
throws GSSException {
183183

@@ -335,7 +335,7 @@ public Oid[] getMechs() {
335335
return mechs.toArray(new Oid[] {});
336336
}
337337

338-
synchronized public void addProviderAtFront(Provider p, Oid mechOid)
338+
public synchronized void addProviderAtFront(Provider p, Oid mechOid)
339339
throws GSSException {
340340

341341
PreferencesEntry newEntry = new PreferencesEntry(p, mechOid);
@@ -367,7 +367,7 @@ synchronized public void addProviderAtFront(Provider p, Oid mechOid)
367367
}
368368
}
369369

370-
synchronized public void addProviderAtEnd(Provider p, Oid mechOid)
370+
public synchronized void addProviderAtEnd(Provider p, Oid mechOid)
371371
throws GSSException {
372372

373373
PreferencesEntry newEntry = new PreferencesEntry(p, mechOid);

src/java.security.jgss/share/classes/sun/security/jgss/TokenTracker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -147,7 +147,7 @@ private int getIntervalIndex(int number) {
147147
* (This analysis leaves out the possibility that expectedNumber passes
148148
* initNumber after wrapping around. That may be added later.)
149149
*/
150-
synchronized public final void getProps(int number, MessageProp prop) {
150+
public final synchronized void getProps(int number, MessageProp prop) {
151151

152152
boolean gap = false;
153153
boolean old = false;

src/java.security.jgss/share/classes/sun/security/krb5/internal/ktab/KeyTab.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -123,7 +123,7 @@ private KeyTab(String filename) {
123123
* @param s file name of keytab, must not be null
124124
* @return the keytab object, can be invalid, but never null.
125125
*/
126-
private synchronized static KeyTab getInstance0(String s) {
126+
private static synchronized KeyTab getInstance0(String s) {
127127
long lm = new File(s).lastModified();
128128
KeyTab old = map.get(s);
129129
if (old != null && old.isValid() && old.lastModified == lm) {
@@ -429,7 +429,7 @@ public KeyTabEntry[] getEntries() {
429429
/**
430430
* Creates a new default key table.
431431
*/
432-
public synchronized static KeyTab create()
432+
public static synchronized KeyTab create()
433433
throws IOException, RealmException {
434434
String dname = getDefaultTabName();
435435
return create(dname);
@@ -438,7 +438,7 @@ public synchronized static KeyTab create()
438438
/**
439439
* Creates a new default key table.
440440
*/
441-
public synchronized static KeyTab create(String name)
441+
public static synchronized KeyTab create(String name)
442442
throws IOException, RealmException {
443443

444444
try (KeyTabOutputStream kos =

src/java.smartcardio/share/classes/javax/smartcardio/CardNotPresentException.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -35,7 +35,7 @@
3535
*/
3636
public class CardNotPresentException extends CardException {
3737

38-
private final static long serialVersionUID = 1346879911706545215L;
38+
private static final long serialVersionUID = 1346879911706545215L;
3939

4040
/**
4141
* Constructs a new CardNotPresentException with the specified detail message.

src/java.smartcardio/share/classes/javax/smartcardio/CardPermission.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -74,17 +74,17 @@ public class CardPermission extends Permission {
7474

7575
private static final long serialVersionUID = 7146787880530705613L;
7676

77-
private final static int A_CONNECT = 0x01;
78-
private final static int A_EXCLUSIVE = 0x02;
79-
private final static int A_GET_BASIC_CHANNEL = 0x04;
80-
private final static int A_OPEN_LOGICAL_CHANNEL = 0x08;
81-
private final static int A_RESET = 0x10;
82-
private final static int A_TRANSMIT_CONTROL = 0x20;
77+
private static final int A_CONNECT = 0x01;
78+
private static final int A_EXCLUSIVE = 0x02;
79+
private static final int A_GET_BASIC_CHANNEL = 0x04;
80+
private static final int A_OPEN_LOGICAL_CHANNEL = 0x08;
81+
private static final int A_RESET = 0x10;
82+
private static final int A_TRANSMIT_CONTROL = 0x20;
8383

8484
// sum of all the actions above
85-
private final static int A_ALL = 0x3f;
85+
private static final int A_ALL = 0x3f;
8686

87-
private final static int[] ARRAY_MASKS = {
87+
private static final int[] ARRAY_MASKS = {
8888
A_ALL,
8989
A_CONNECT,
9090
A_EXCLUSIVE,
@@ -94,16 +94,16 @@ public class CardPermission extends Permission {
9494
A_TRANSMIT_CONTROL,
9595
};
9696

97-
private final static String S_CONNECT = "connect";
98-
private final static String S_EXCLUSIVE = "exclusive";
99-
private final static String S_GET_BASIC_CHANNEL = "getBasicChannel";
100-
private final static String S_OPEN_LOGICAL_CHANNEL = "openLogicalChannel";
101-
private final static String S_RESET = "reset";
102-
private final static String S_TRANSMIT_CONTROL = "transmitControl";
97+
private static final String S_CONNECT = "connect";
98+
private static final String S_EXCLUSIVE = "exclusive";
99+
private static final String S_GET_BASIC_CHANNEL = "getBasicChannel";
100+
private static final String S_OPEN_LOGICAL_CHANNEL = "openLogicalChannel";
101+
private static final String S_RESET = "reset";
102+
private static final String S_TRANSMIT_CONTROL = "transmitControl";
103103

104-
private final static String S_ALL = "*";
104+
private static final String S_ALL = "*";
105105

106-
private final static String[] ARRAY_STRINGS = {
106+
private static final String[] ARRAY_STRINGS = {
107107
S_ALL,
108108
S_CONNECT,
109109
S_EXCLUSIVE,

src/java.smartcardio/share/classes/javax/smartcardio/TerminalFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,12 @@
8888
*/
8989
public final class TerminalFactory {
9090

91-
private final static String PROP_NAME =
91+
private static final String PROP_NAME =
9292
"javax.smartcardio.TerminalFactory.DefaultType";
9393

94-
private final static String defaultType;
94+
private static final String defaultType;
9595

96-
private final static TerminalFactory defaultFactory;
96+
private static final TerminalFactory defaultFactory;
9797

9898
static {
9999
// lookup up the user specified type, default to PC/SC
@@ -133,14 +133,14 @@ public final class TerminalFactory {
133133
private static final class NoneProvider extends Provider {
134134

135135
private static final long serialVersionUID = 2745808869881593918L;
136-
final static Provider INSTANCE = new NoneProvider();
136+
static final Provider INSTANCE = new NoneProvider();
137137
private NoneProvider() {
138138
super("None", "1.0", "none");
139139
}
140140
}
141141

142142
private static final class NoneFactorySpi extends TerminalFactorySpi {
143-
final static TerminalFactorySpi INSTANCE = new NoneFactorySpi();
143+
static final TerminalFactorySpi INSTANCE = new NoneFactorySpi();
144144
private NoneFactorySpi() {
145145
// empty
146146
}
@@ -150,7 +150,7 @@ protected CardTerminals engineTerminals() {
150150
}
151151

152152
private static final class NoneCardTerminals extends CardTerminals {
153-
final static CardTerminals INSTANCE = new NoneCardTerminals();
153+
static final CardTerminals INSTANCE = new NoneCardTerminals();
154154
private NoneCardTerminals() {
155155
// empty
156156
}

src/java.smartcardio/share/classes/sun/security/smartcardio/ChannelImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ public int transmit(ByteBuffer command, ByteBuffer response) throws CardExceptio
114114
return responseBytes.length;
115115
}
116116

117-
private final static boolean t0GetResponse =
117+
private static final boolean t0GetResponse =
118118
getBooleanProperty("sun.security.smartcardio.t0GetResponse", true);
119119

120-
private final static boolean t1GetResponse =
120+
private static final boolean t1GetResponse =
121121
getBooleanProperty("sun.security.smartcardio.t1GetResponse", true);
122122

123-
private final static boolean t1StripLe =
123+
private static final boolean t1StripLe =
124124
getBooleanProperty("sun.security.smartcardio.t1StripLe", false);
125125

126126
private static boolean getBooleanProperty(String name, boolean def) {
@@ -151,8 +151,8 @@ private byte[] concat(byte[] b1, byte[] b2, int n2) {
151151
return res;
152152
}
153153

154-
private final static int RESPONSE_ITERATIONS = 256;
155-
private final static byte[] B0 = new byte[0];
154+
private static final int RESPONSE_ITERATIONS = 256;
155+
private static final byte[] B0 = new byte[0];
156156

157157
private byte[] doTransmit(byte[] command) throws CardException {
158158
// note that we modify the 'command' array in some cases, so it must

src/java.smartcardio/share/classes/sun/security/smartcardio/PCSC.java

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -93,83 +93,83 @@ static void checkAvailable() throws RuntimeException {
9393
throws PCSCException;
9494

9595
// PCSC success/error/failure/warning codes
96-
final static int SCARD_S_SUCCESS = 0x00000000;
97-
final static int SCARD_E_CANCELLED = 0x80100002;
98-
final static int SCARD_E_CANT_DISPOSE = 0x8010000E;
99-
final static int SCARD_E_INSUFFICIENT_BUFFER = 0x80100008;
100-
final static int SCARD_E_INVALID_ATR = 0x80100015;
101-
final static int SCARD_E_INVALID_HANDLE = 0x80100003;
102-
final static int SCARD_E_INVALID_PARAMETER = 0x80100004;
103-
final static int SCARD_E_INVALID_TARGET = 0x80100005;
104-
final static int SCARD_E_INVALID_VALUE = 0x80100011;
105-
final static int SCARD_E_NO_MEMORY = 0x80100006;
106-
final static int SCARD_F_COMM_ERROR = 0x80100013;
107-
final static int SCARD_F_INTERNAL_ERROR = 0x80100001;
108-
final static int SCARD_F_UNKNOWN_ERROR = 0x80100014;
109-
final static int SCARD_F_WAITED_TOO_LONG = 0x80100007;
110-
final static int SCARD_E_UNKNOWN_READER = 0x80100009;
111-
final static int SCARD_E_TIMEOUT = 0x8010000A;
112-
final static int SCARD_E_SHARING_VIOLATION = 0x8010000B;
113-
final static int SCARD_E_NO_SMARTCARD = 0x8010000C;
114-
final static int SCARD_E_UNKNOWN_CARD = 0x8010000D;
115-
final static int SCARD_E_PROTO_MISMATCH = 0x8010000F;
116-
final static int SCARD_E_NOT_READY = 0x80100010;
117-
final static int SCARD_E_SYSTEM_CANCELLED = 0x80100012;
118-
final static int SCARD_E_NOT_TRANSACTED = 0x80100016;
119-
final static int SCARD_E_READER_UNAVAILABLE = 0x80100017;
120-
121-
final static int SCARD_W_UNSUPPORTED_CARD = 0x80100065;
122-
final static int SCARD_W_UNRESPONSIVE_CARD = 0x80100066;
123-
final static int SCARD_W_UNPOWERED_CARD = 0x80100067;
124-
final static int SCARD_W_RESET_CARD = 0x80100068;
125-
final static int SCARD_W_REMOVED_CARD = 0x80100069;
126-
final static int SCARD_W_INSERTED_CARD = 0x8010006A;
127-
128-
final static int SCARD_E_UNSUPPORTED_FEATURE = 0x8010001F;
129-
final static int SCARD_E_PCI_TOO_SMALL = 0x80100019;
130-
final static int SCARD_E_READER_UNSUPPORTED = 0x8010001A;
131-
final static int SCARD_E_DUPLICATE_READER = 0x8010001B;
132-
final static int SCARD_E_CARD_UNSUPPORTED = 0x8010001C;
133-
final static int SCARD_E_NO_SERVICE = 0x8010001D;
134-
final static int SCARD_E_SERVICE_STOPPED = 0x8010001E;
96+
static final int SCARD_S_SUCCESS = 0x00000000;
97+
static final int SCARD_E_CANCELLED = 0x80100002;
98+
static final int SCARD_E_CANT_DISPOSE = 0x8010000E;
99+
static final int SCARD_E_INSUFFICIENT_BUFFER = 0x80100008;
100+
static final int SCARD_E_INVALID_ATR = 0x80100015;
101+
static final int SCARD_E_INVALID_HANDLE = 0x80100003;
102+
static final int SCARD_E_INVALID_PARAMETER = 0x80100004;
103+
static final int SCARD_E_INVALID_TARGET = 0x80100005;
104+
static final int SCARD_E_INVALID_VALUE = 0x80100011;
105+
static final int SCARD_E_NO_MEMORY = 0x80100006;
106+
static final int SCARD_F_COMM_ERROR = 0x80100013;
107+
static final int SCARD_F_INTERNAL_ERROR = 0x80100001;
108+
static final int SCARD_F_UNKNOWN_ERROR = 0x80100014;
109+
static final int SCARD_F_WAITED_TOO_LONG = 0x80100007;
110+
static final int SCARD_E_UNKNOWN_READER = 0x80100009;
111+
static final int SCARD_E_TIMEOUT = 0x8010000A;
112+
static final int SCARD_E_SHARING_VIOLATION = 0x8010000B;
113+
static final int SCARD_E_NO_SMARTCARD = 0x8010000C;
114+
static final int SCARD_E_UNKNOWN_CARD = 0x8010000D;
115+
static final int SCARD_E_PROTO_MISMATCH = 0x8010000F;
116+
static final int SCARD_E_NOT_READY = 0x80100010;
117+
static final int SCARD_E_SYSTEM_CANCELLED = 0x80100012;
118+
static final int SCARD_E_NOT_TRANSACTED = 0x80100016;
119+
static final int SCARD_E_READER_UNAVAILABLE = 0x80100017;
120+
121+
static final int SCARD_W_UNSUPPORTED_CARD = 0x80100065;
122+
static final int SCARD_W_UNRESPONSIVE_CARD = 0x80100066;
123+
static final int SCARD_W_UNPOWERED_CARD = 0x80100067;
124+
static final int SCARD_W_RESET_CARD = 0x80100068;
125+
static final int SCARD_W_REMOVED_CARD = 0x80100069;
126+
static final int SCARD_W_INSERTED_CARD = 0x8010006A;
127+
128+
static final int SCARD_E_UNSUPPORTED_FEATURE = 0x8010001F;
129+
static final int SCARD_E_PCI_TOO_SMALL = 0x80100019;
130+
static final int SCARD_E_READER_UNSUPPORTED = 0x8010001A;
131+
static final int SCARD_E_DUPLICATE_READER = 0x8010001B;
132+
static final int SCARD_E_CARD_UNSUPPORTED = 0x8010001C;
133+
static final int SCARD_E_NO_SERVICE = 0x8010001D;
134+
static final int SCARD_E_SERVICE_STOPPED = 0x8010001E;
135135

136136
// MS undocumented
137-
final static int SCARD_E_NO_READERS_AVAILABLE = 0x8010002E;
137+
static final int SCARD_E_NO_READERS_AVAILABLE = 0x8010002E;
138138
// std. Windows invalid handle return code, used instead of SCARD code
139-
final static int WINDOWS_ERROR_INVALID_HANDLE = 6;
140-
final static int WINDOWS_ERROR_INVALID_PARAMETER = 87;
139+
static final int WINDOWS_ERROR_INVALID_HANDLE = 6;
140+
static final int WINDOWS_ERROR_INVALID_PARAMETER = 87;
141141

142142
//
143-
final static int SCARD_SCOPE_USER = 0x0000;
144-
final static int SCARD_SCOPE_TERMINAL = 0x0001;
145-
final static int SCARD_SCOPE_SYSTEM = 0x0002;
146-
final static int SCARD_SCOPE_GLOBAL = 0x0003;
147-
148-
final static int SCARD_SHARE_EXCLUSIVE = 0x0001;
149-
final static int SCARD_SHARE_SHARED = 0x0002;
150-
final static int SCARD_SHARE_DIRECT = 0x0003;
151-
152-
final static int SCARD_LEAVE_CARD = 0x0000;
153-
final static int SCARD_RESET_CARD = 0x0001;
154-
final static int SCARD_UNPOWER_CARD = 0x0002;
155-
final static int SCARD_EJECT_CARD = 0x0003;
156-
157-
final static int SCARD_STATE_UNAWARE = 0x0000;
158-
final static int SCARD_STATE_IGNORE = 0x0001;
159-
final static int SCARD_STATE_CHANGED = 0x0002;
160-
final static int SCARD_STATE_UNKNOWN = 0x0004;
161-
final static int SCARD_STATE_UNAVAILABLE = 0x0008;
162-
final static int SCARD_STATE_EMPTY = 0x0010;
163-
final static int SCARD_STATE_PRESENT = 0x0020;
164-
final static int SCARD_STATE_ATRMATCH = 0x0040;
165-
final static int SCARD_STATE_EXCLUSIVE = 0x0080;
166-
final static int SCARD_STATE_INUSE = 0x0100;
167-
final static int SCARD_STATE_MUTE = 0x0200;
168-
final static int SCARD_STATE_UNPOWERED = 0x0400;
169-
170-
final static int TIMEOUT_INFINITE = 0xffffffff;
171-
172-
private final static char[] hexDigits = "0123456789abcdef".toCharArray();
143+
static final int SCARD_SCOPE_USER = 0x0000;
144+
static final int SCARD_SCOPE_TERMINAL = 0x0001;
145+
static final int SCARD_SCOPE_SYSTEM = 0x0002;
146+
static final int SCARD_SCOPE_GLOBAL = 0x0003;
147+
148+
static final int SCARD_SHARE_EXCLUSIVE = 0x0001;
149+
static final int SCARD_SHARE_SHARED = 0x0002;
150+
static final int SCARD_SHARE_DIRECT = 0x0003;
151+
152+
static final int SCARD_LEAVE_CARD = 0x0000;
153+
static final int SCARD_RESET_CARD = 0x0001;
154+
static final int SCARD_UNPOWER_CARD = 0x0002;
155+
static final int SCARD_EJECT_CARD = 0x0003;
156+
157+
static final int SCARD_STATE_UNAWARE = 0x0000;
158+
static final int SCARD_STATE_IGNORE = 0x0001;
159+
static final int SCARD_STATE_CHANGED = 0x0002;
160+
static final int SCARD_STATE_UNKNOWN = 0x0004;
161+
static final int SCARD_STATE_UNAVAILABLE = 0x0008;
162+
static final int SCARD_STATE_EMPTY = 0x0010;
163+
static final int SCARD_STATE_PRESENT = 0x0020;
164+
static final int SCARD_STATE_ATRMATCH = 0x0040;
165+
static final int SCARD_STATE_EXCLUSIVE = 0x0080;
166+
static final int SCARD_STATE_INUSE = 0x0100;
167+
static final int SCARD_STATE_MUTE = 0x0200;
168+
static final int SCARD_STATE_UNPOWERED = 0x0400;
169+
170+
static final int TIMEOUT_INFINITE = 0xffffffff;
171+
172+
private static final char[] hexDigits = "0123456789abcdef".toCharArray();
173173

174174
public static String toString(byte[] b) {
175175
StringBuilder sb = new StringBuilder(b.length * 3);

0 commit comments

Comments
 (0)