8263855: Use the blessed modifier order in java.management/naming

Reviewed-by: redestad, aefimov, dfuchs
This commit is contained in:
Alex Blewitt 2021-03-22 13:38:19 +00:00 committed by Claes Redestad
parent 6f1bcb056a
commit 5262d95b12
69 changed files with 261 additions and 261 deletions

View File

@ -1720,53 +1720,53 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
// Method IDs for doOperation // Method IDs for doOperation
//--------------------------- //---------------------------
private final static int private static final int
ADD_NOTIFICATION_LISTENERS = 1; ADD_NOTIFICATION_LISTENERS = 1;
private final static int private static final int
ADD_NOTIFICATION_LISTENER_OBJECTNAME = 2; ADD_NOTIFICATION_LISTENER_OBJECTNAME = 2;
private final static int private static final int
CREATE_MBEAN = 3; CREATE_MBEAN = 3;
private final static int private static final int
CREATE_MBEAN_PARAMS = 4; CREATE_MBEAN_PARAMS = 4;
private final static int private static final int
CREATE_MBEAN_LOADER = 5; CREATE_MBEAN_LOADER = 5;
private final static int private static final int
CREATE_MBEAN_LOADER_PARAMS = 6; CREATE_MBEAN_LOADER_PARAMS = 6;
private final static int private static final int
GET_ATTRIBUTE = 7; GET_ATTRIBUTE = 7;
private final static int private static final int
GET_ATTRIBUTES = 8; GET_ATTRIBUTES = 8;
private final static int private static final int
GET_DEFAULT_DOMAIN = 9; GET_DEFAULT_DOMAIN = 9;
private final static int private static final int
GET_DOMAINS = 10; GET_DOMAINS = 10;
private final static int private static final int
GET_MBEAN_COUNT = 11; GET_MBEAN_COUNT = 11;
private final static int private static final int
GET_MBEAN_INFO = 12; GET_MBEAN_INFO = 12;
private final static int private static final int
GET_OBJECT_INSTANCE = 13; GET_OBJECT_INSTANCE = 13;
private final static int private static final int
INVOKE = 14; INVOKE = 14;
private final static int private static final int
IS_INSTANCE_OF = 15; IS_INSTANCE_OF = 15;
private final static int private static final int
IS_REGISTERED = 16; IS_REGISTERED = 16;
private final static int private static final int
QUERY_MBEANS = 17; QUERY_MBEANS = 17;
private final static int private static final int
QUERY_NAMES = 18; QUERY_NAMES = 18;
private final static int private static final int
REMOVE_NOTIFICATION_LISTENER = 19; REMOVE_NOTIFICATION_LISTENER = 19;
private final static int private static final int
REMOVE_NOTIFICATION_LISTENER_OBJECTNAME = 20; REMOVE_NOTIFICATION_LISTENER_OBJECTNAME = 20;
private final static int private static final int
REMOVE_NOTIFICATION_LISTENER_OBJECTNAME_FILTER_HANDBACK = 21; REMOVE_NOTIFICATION_LISTENER_OBJECTNAME_FILTER_HANDBACK = 21;
private final static int private static final int
SET_ATTRIBUTE = 22; SET_ATTRIBUTE = 22;
private final static int private static final int
SET_ATTRIBUTES = 23; SET_ATTRIBUTES = 23;
private final static int private static final int
UNREGISTER_MBEAN = 24; UNREGISTER_MBEAN = 24;
// SERVER NOTIFICATION // SERVER NOTIFICATION
@ -1794,7 +1794,7 @@ public class RMIConnectionImpl implements RMIConnection, Unreferenced {
private static final class CombinedClassLoader extends ClassLoader { private static final class CombinedClassLoader extends ClassLoader {
private final static class ClassLoaderWrapper extends ClassLoader { private static final class ClassLoaderWrapper extends ClassLoader {
ClassLoaderWrapper(ClassLoader cl) { ClassLoaderWrapper(ClassLoader cl) {
super(cl); super(cl);
} }

View File

@ -855,6 +855,6 @@ public class RMIConnectorServer extends JMXConnectorServer {
private static final int STOPPED = 2; private static final int STOPPED = 2;
private int state = CREATED; private int state = CREATED;
private final static Set<RMIConnectorServer> openedServers = private static final Set<RMIConnectorServer> openedServers =
new HashSet<RMIConnectorServer>(); new HashSet<RMIConnectorServer>();
} }

View File

@ -1516,6 +1516,6 @@ public class DefaultMXBeanMappingFactory extends MXBeanMappingFactory {
return rest; return rest;
} }
private final static Map<Type, Type> inProgress = newIdentityHashMap(); private static final Map<Type, Type> inProgress = newIdentityHashMap();
// really an IdentityHashSet but that doesn't exist // really an IdentityHashSet but that doesn't exist
} }

View File

@ -59,7 +59,7 @@ public class DescriptorCache {
return get(ImmutableDescriptor.union(descriptors)); return get(ImmutableDescriptor.union(descriptors));
} }
private final static DescriptorCache instance = new DescriptorCache(); private static final DescriptorCache instance = new DescriptorCache();
private final WeakHashMap<ImmutableDescriptor, private final WeakHashMap<ImmutableDescriptor,
WeakReference<ImmutableDescriptor>> WeakReference<ImmutableDescriptor>>
map = new WeakHashMap<ImmutableDescriptor, map = new WeakHashMap<ImmutableDescriptor,

View File

@ -225,7 +225,7 @@ class MBeanAnalyzer<M> {
return -1; return -1;
return +1; // could assert bret.isAssignableFrom(aret) return +1; // could assert bret.isAssignableFrom(aret)
} }
public final static MethodOrder instance = new MethodOrder(); public static final MethodOrder instance = new MethodOrder();
} }

View File

@ -108,7 +108,7 @@ public class Repository {
// Private methods ---------------------------------------------> // Private methods --------------------------------------------->
/* This class is used to match an ObjectName against a pattern. */ /* This class is used to match an ObjectName against a pattern. */
private final static class ObjectNamePattern { private static final class ObjectNamePattern {
private final String[] keys; private final String[] keys;
private final String[] values; private final String[] values;
private final String properties; private final String properties;

View File

@ -243,10 +243,10 @@ public abstract class ClientCommunicatorAdmin {
private long period; private long period;
// state // state
private final static int CONNECTED = 0; private static final int CONNECTED = 0;
private final static int RE_CONNECTING = 1; private static final int RE_CONNECTING = 1;
private final static int FAILED = 2; private static final int FAILED = 2;
private final static int TERMINATED = 3; private static final int TERMINATED = 3;
private int state = CONNECTED; private int state = CONNECTED;

View File

@ -485,7 +485,7 @@ public class ServerNotifForwarder {
private final long connectionTimeout; private final long connectionTimeout;
private static int listenerCounter = 0; private static int listenerCounter = 0;
private final static int[] listenerCounterLock = new int[0]; private static final int[] listenerCounterLock = new int[0];
private NotificationBuffer notifBuffer; private NotificationBuffer notifBuffer;
private final Map<ObjectName, Set<IdAndFilter>> listenerMap = private final Map<ObjectName, Set<IdAndFilter>> listenerMap =

View File

@ -398,7 +398,7 @@ public class MBeanServerFileAccessController
} }
private static class Parser { private static class Parser {
private final static int EOS = -1; // pseudo-codepoint "end of string" private static final int EOS = -1; // pseudo-codepoint "end of string"
static { static {
assert !Character.isWhitespace(EOS); assert !Character.isWhitespace(EOS);
} }

View File

@ -254,42 +254,42 @@ public class ManagementFactory {
* String representation of the * String representation of the
* {@code ObjectName} for the {@link ClassLoadingMXBean}. * {@code ObjectName} for the {@link ClassLoadingMXBean}.
*/ */
public final static String CLASS_LOADING_MXBEAN_NAME = public static final String CLASS_LOADING_MXBEAN_NAME =
"java.lang:type=ClassLoading"; "java.lang:type=ClassLoading";
/** /**
* String representation of the * String representation of the
* {@code ObjectName} for the {@link CompilationMXBean}. * {@code ObjectName} for the {@link CompilationMXBean}.
*/ */
public final static String COMPILATION_MXBEAN_NAME = public static final String COMPILATION_MXBEAN_NAME =
"java.lang:type=Compilation"; "java.lang:type=Compilation";
/** /**
* String representation of the * String representation of the
* {@code ObjectName} for the {@link MemoryMXBean}. * {@code ObjectName} for the {@link MemoryMXBean}.
*/ */
public final static String MEMORY_MXBEAN_NAME = public static final String MEMORY_MXBEAN_NAME =
"java.lang:type=Memory"; "java.lang:type=Memory";
/** /**
* String representation of the * String representation of the
* {@code ObjectName} for the {@link OperatingSystemMXBean}. * {@code ObjectName} for the {@link OperatingSystemMXBean}.
*/ */
public final static String OPERATING_SYSTEM_MXBEAN_NAME = public static final String OPERATING_SYSTEM_MXBEAN_NAME =
"java.lang:type=OperatingSystem"; "java.lang:type=OperatingSystem";
/** /**
* String representation of the * String representation of the
* {@code ObjectName} for the {@link RuntimeMXBean}. * {@code ObjectName} for the {@link RuntimeMXBean}.
*/ */
public final static String RUNTIME_MXBEAN_NAME = public static final String RUNTIME_MXBEAN_NAME =
"java.lang:type=Runtime"; "java.lang:type=Runtime";
/** /**
* String representation of the * String representation of the
* {@code ObjectName} for the {@link ThreadMXBean}. * {@code ObjectName} for the {@link ThreadMXBean}.
*/ */
public final static String THREAD_MXBEAN_NAME = public static final String THREAD_MXBEAN_NAME =
"java.lang:type=Threading"; "java.lang:type=Threading";
/** /**
@ -299,7 +299,7 @@ public class ManagementFactory {
* can be formed by appending this string with * can be formed by appending this string with
* "{@code ,name=}<i>collector's name</i>". * "{@code ,name=}<i>collector's name</i>".
*/ */
public final static String GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE = public static final String GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE =
"java.lang:type=GarbageCollector"; "java.lang:type=GarbageCollector";
/** /**
@ -309,7 +309,7 @@ public class ManagementFactory {
* can be formed by appending this string with * can be formed by appending this string with
* "{@code ,name=}<i>manager's name</i>". * "{@code ,name=}<i>manager's name</i>".
*/ */
public final static String MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE= public static final String MEMORY_MANAGER_MXBEAN_DOMAIN_TYPE=
"java.lang:type=MemoryManager"; "java.lang:type=MemoryManager";
/** /**
@ -319,7 +319,7 @@ public class ManagementFactory {
* can be formed by appending this string with * can be formed by appending this string with
* {@code ,name=}<i>pool's name</i>. * {@code ,name=}<i>pool's name</i>.
*/ */
public final static String MEMORY_POOL_MXBEAN_DOMAIN_TYPE= public static final String MEMORY_POOL_MXBEAN_DOMAIN_TYPE=
"java.lang:type=MemoryPool"; "java.lang:type=MemoryPool";
/** /**

View File

@ -69,21 +69,21 @@ import java.util.StringTokenizer;
public class MBeanServerPermission extends BasicPermission { public class MBeanServerPermission extends BasicPermission {
private static final long serialVersionUID = -5661980843569388590L; private static final long serialVersionUID = -5661980843569388590L;
private final static int private static final int
CREATE = 0, CREATE = 0,
FIND = 1, FIND = 1,
NEW = 2, NEW = 2,
RELEASE = 3, RELEASE = 3,
N_NAMES = 4; N_NAMES = 4;
private final static String[] names = { private static final String[] names = {
"createMBeanServer", "createMBeanServer",
"findMBeanServer", "findMBeanServer",
"newMBeanServer", "newMBeanServer",
"releaseMBeanServer", "releaseMBeanServer",
}; };
private final static int private static final int
CREATE_MASK = 1<<CREATE, CREATE_MASK = 1<<CREATE,
FIND_MASK = 1<<FIND, FIND_MASK = 1<<FIND,
NEW_MASK = 1<<NEW, NEW_MASK = 1<<NEW,
@ -98,7 +98,7 @@ public class MBeanServerPermission extends BasicPermission {
* permissions, we should consider doing this differently, * permissions, we should consider doing this differently,
* e.g. with a Map. * e.g. with a Map.
*/ */
private final static String[] canonicalNames = new String[1 << N_NAMES]; private static final String[] canonicalNames = new String[1 << N_NAMES];
/* /*
* The target names mask. This is not private to avoid having to * The target names mask. This is not private to avoid having to

View File

@ -331,7 +331,7 @@ public class NotificationBroadcasterSupport implements NotificationEmitter {
private final Executor executor; private final Executor executor;
private final MBeanNotificationInfo[] notifInfo; private final MBeanNotificationInfo[] notifInfo;
private final static Executor defaultExecutor = new Executor() { private static final Executor defaultExecutor = new Executor() {
// DirectExecutor using caller thread // DirectExecutor using caller thread
public void execute(Runnable r) { public void execute(Runnable r) {
r.run(); r.run();

View File

@ -125,7 +125,7 @@ import javax.management.openmbean.OpenMBeanParameterInfoSupport;
*/ */
public class StandardMBean implements DynamicMBean, MBeanRegistration { public class StandardMBean implements DynamicMBean, MBeanRegistration {
private final static DescriptorCache descriptors = private static final DescriptorCache descriptors =
DescriptorCache.getInstance(JMX.proof); DescriptorCache.getInstance(JMX.proof);
/** /**

View File

@ -179,7 +179,7 @@ public class ModelMBeanAttributeInfo
*/ */
private Descriptor attrDescriptor = validDescriptor(null); private Descriptor attrDescriptor = validDescriptor(null);
private final static String currClass = "ModelMBeanAttributeInfo"; private static final String currClass = "ModelMBeanAttributeInfo";
/** /**
* Constructs a ModelMBeanAttributeInfo object with a default * Constructs a ModelMBeanAttributeInfo object with a default

View File

@ -151,7 +151,7 @@ public class ModelMBeanConstructorInfo
*/ */
private Descriptor consDescriptor = validDescriptor(null); private Descriptor consDescriptor = validDescriptor(null);
private final static String currClass = "ModelMBeanConstructorInfo"; private static final String currClass = "ModelMBeanConstructorInfo";
/** /**

View File

@ -142,7 +142,7 @@ public class RequiredModelMBean
private boolean registered = false; private boolean registered = false;
private transient MBeanServer server = null; private transient MBeanServer server = null;
private final static JavaSecurityAccess javaSecurityAccess = SharedSecrets.getJavaSecurityAccess(); private static final JavaSecurityAccess javaSecurityAccess = SharedSecrets.getJavaSecurityAccess();
final private AccessControlContext acc = AccessController.getContext(); final private AccessControlContext acc = AccessController.getContext();
/*************************************/ /*************************************/

View File

@ -253,7 +253,7 @@ public abstract class Monitor
* automatically incremented when their size becomes greater than * automatically incremented when their size becomes greater than
* their capacity. * their capacity.
*/ */
protected final static int capacityIncrement = 16; protected static final int capacityIncrement = 16;
/** /**
* The number of valid components in the vector of observed objects. * The number of valid components in the vector of observed objects.

View File

@ -727,11 +727,11 @@ public class JMXServiceURL implements Serializable {
return i; return i;
} }
private final static BitSet alphaBitSet = new BitSet(128); private static final BitSet alphaBitSet = new BitSet(128);
private final static BitSet numericBitSet = new BitSet(128); private static final BitSet numericBitSet = new BitSet(128);
private final static BitSet alphaNumericBitSet = new BitSet(128); private static final BitSet alphaNumericBitSet = new BitSet(128);
private final static BitSet protocolBitSet = new BitSet(128); private static final BitSet protocolBitSet = new BitSet(128);
private final static BitSet hostNameBitSet = new BitSet(128); private static final BitSet hostNameBitSet = new BitSet(128);
static { static {
/* J2SE 1.4 adds lots of handy methods to BitSet that would /* J2SE 1.4 adds lots of handy methods to BitSet that would
allow us to simplify here, e.g. by not writing loops, but allow us to simplify here, e.g. by not writing loops, but

View File

@ -39,7 +39,7 @@ import javax.management.ObjectName;
public class HotspotInternal public class HotspotInternal
implements HotspotInternalMBean, MBeanRegistration { implements HotspotInternalMBean, MBeanRegistration {
private final static String HOTSPOT_INTERNAL_MBEAN_NAME = private static final String HOTSPOT_INTERNAL_MBEAN_NAME =
"sun.management:type=HotspotInternal"; "sun.management:type=HotspotInternal";
private static ObjectName objName = Util.newObjectName(HOTSPOT_INTERNAL_MBEAN_NAME); private static ObjectName objName = Util.newObjectName(HOTSPOT_INTERNAL_MBEAN_NAME);
private MBeanServer server = null; private MBeanServer server = null;

View File

@ -183,9 +183,9 @@ public class ManagementFactoryHelper {
// //
static final class LoggingMXBeanAccess { static final class LoggingMXBeanAccess {
final static String LOG_MANAGER_CLASS_NAME = "java.util.logging.LogManager"; static final String LOG_MANAGER_CLASS_NAME = "java.util.logging.LogManager";
final static String LOGGING_MXBEAN_CLASS_NAME = "java.util.logging.LoggingMXBean"; static final String LOGGING_MXBEAN_CLASS_NAME = "java.util.logging.LoggingMXBean";
final static Class<?> LOG_MANAGER_CLASS = loadLoggingClass(LOG_MANAGER_CLASS_NAME); static final Class<?> LOG_MANAGER_CLASS = loadLoggingClass(LOG_MANAGER_CLASS_NAME);
static boolean isAvailable() { static boolean isAvailable() {
return LOG_MANAGER_CLASS != null; return LOG_MANAGER_CLASS != null;
@ -355,7 +355,7 @@ public class ManagementFactoryHelper {
return bufferPools; return bufferPools;
} }
private final static String BUFFER_POOL_MXBEAN_NAME = "java.nio:type=BufferPool"; private static final String BUFFER_POOL_MXBEAN_NAME = "java.nio:type=BufferPool";
/** /**
* Creates management interface for the given buffer pool. * Creates management interface for the given buffer pool.
@ -484,19 +484,19 @@ public class ManagementFactoryHelper {
} }
} }
private final static String HOTSPOT_CLASS_LOADING_MBEAN_NAME = private static final String HOTSPOT_CLASS_LOADING_MBEAN_NAME =
"sun.management:type=HotspotClassLoading"; "sun.management:type=HotspotClassLoading";
private final static String HOTSPOT_COMPILATION_MBEAN_NAME = private static final String HOTSPOT_COMPILATION_MBEAN_NAME =
"sun.management:type=HotspotCompilation"; "sun.management:type=HotspotCompilation";
private final static String HOTSPOT_MEMORY_MBEAN_NAME = private static final String HOTSPOT_MEMORY_MBEAN_NAME =
"sun.management:type=HotspotMemory"; "sun.management:type=HotspotMemory";
private static final String HOTSPOT_RUNTIME_MBEAN_NAME = private static final String HOTSPOT_RUNTIME_MBEAN_NAME =
"sun.management:type=HotspotRuntime"; "sun.management:type=HotspotRuntime";
private final static String HOTSPOT_THREAD_MBEAN_NAME = private static final String HOTSPOT_THREAD_MBEAN_NAME =
"sun.management:type=HotspotThreading"; "sun.management:type=HotspotThreading";
static void registerInternalMBeans(MBeanServer mbs) { static void registerInternalMBeans(MBeanServer mbs) {

View File

@ -104,13 +104,13 @@ class MemoryImpl extends NotificationEmitterSupport
private native MemoryUsage getMemoryUsage0(boolean heap); private native MemoryUsage getMemoryUsage0(boolean heap);
private native void setVerboseGC(boolean value); private native void setVerboseGC(boolean value);
private final static String notifName = private static final String notifName =
"javax.management.Notification"; "javax.management.Notification";
private final static String[] notifTypes = { private static final String[] notifTypes = {
MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED, MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED,
MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED
}; };
private final static String[] notifMsgs = { private static final String[] notifMsgs = {
"Memory usage exceeds usage threshold", "Memory usage exceeds usage threshold",
"Memory usage exceeds collection usage threshold" "Memory usage exceeds collection usage threshold"
}; };

View File

@ -31,27 +31,27 @@ import java.io.UnsupportedEncodingException;
class PerfDataEntry { class PerfDataEntry {
private class EntryFieldOffset { private class EntryFieldOffset {
private final static int SIZEOF_BYTE = 1; private static final int SIZEOF_BYTE = 1;
private final static int SIZEOF_INT = 4; private static final int SIZEOF_INT = 4;
private final static int SIZEOF_LONG = 8; private static final int SIZEOF_LONG = 8;
private final static int ENTRY_LENGTH_SIZE = SIZEOF_INT; private static final int ENTRY_LENGTH_SIZE = SIZEOF_INT;
private final static int NAME_OFFSET_SIZE = SIZEOF_INT; private static final int NAME_OFFSET_SIZE = SIZEOF_INT;
private final static int VECTOR_LENGTH_SIZE = SIZEOF_INT; private static final int VECTOR_LENGTH_SIZE = SIZEOF_INT;
private final static int DATA_TYPE_SIZE = SIZEOF_BYTE; private static final int DATA_TYPE_SIZE = SIZEOF_BYTE;
private final static int FLAGS_SIZE = SIZEOF_BYTE; private static final int FLAGS_SIZE = SIZEOF_BYTE;
private final static int DATA_UNIT_SIZE = SIZEOF_BYTE; private static final int DATA_UNIT_SIZE = SIZEOF_BYTE;
private final static int DATA_VAR_SIZE = SIZEOF_BYTE; private static final int DATA_VAR_SIZE = SIZEOF_BYTE;
private final static int DATA_OFFSET_SIZE = SIZEOF_INT; private static final int DATA_OFFSET_SIZE = SIZEOF_INT;
final static int ENTRY_LENGTH = 0; static final int ENTRY_LENGTH = 0;
final static int NAME_OFFSET = ENTRY_LENGTH + ENTRY_LENGTH_SIZE; static final int NAME_OFFSET = ENTRY_LENGTH + ENTRY_LENGTH_SIZE;
final static int VECTOR_LENGTH = NAME_OFFSET + NAME_OFFSET_SIZE;; static final int VECTOR_LENGTH = NAME_OFFSET + NAME_OFFSET_SIZE;;
final static int DATA_TYPE = VECTOR_LENGTH + VECTOR_LENGTH_SIZE; static final int DATA_TYPE = VECTOR_LENGTH + VECTOR_LENGTH_SIZE;
final static int FLAGS = DATA_TYPE + DATA_TYPE_SIZE; static final int FLAGS = DATA_TYPE + DATA_TYPE_SIZE;
final static int DATA_UNIT = FLAGS + FLAGS_SIZE; static final int DATA_UNIT = FLAGS + FLAGS_SIZE;
final static int DATA_VAR = DATA_UNIT + DATA_UNIT_SIZE; static final int DATA_VAR = DATA_UNIT + DATA_UNIT_SIZE;
final static int DATA_OFFSET = DATA_VAR + DATA_VAR_SIZE; static final int DATA_OFFSET = DATA_VAR + DATA_VAR_SIZE;
} }
private String name; private String name;

View File

@ -30,39 +30,39 @@ import java.nio.*;
class Prologue { class Prologue {
// these constants should match their #define counterparts in vmdata.hpp // these constants should match their #define counterparts in vmdata.hpp
private final static byte PERFDATA_BIG_ENDIAN = 0; private static final byte PERFDATA_BIG_ENDIAN = 0;
private final static byte PERFDATA_LITTLE_ENDIAN = 1; private static final byte PERFDATA_LITTLE_ENDIAN = 1;
private final static int PERFDATA_MAGIC = 0xcafec0c0; private static final int PERFDATA_MAGIC = 0xcafec0c0;
private class PrologueFieldOffset { private class PrologueFieldOffset {
private final static int SIZEOF_BYTE = 1; private static final int SIZEOF_BYTE = 1;
private final static int SIZEOF_INT = 4; private static final int SIZEOF_INT = 4;
private final static int SIZEOF_LONG = 8; private static final int SIZEOF_LONG = 8;
private final static int MAGIC_SIZE = SIZEOF_INT; private static final int MAGIC_SIZE = SIZEOF_INT;
private final static int BYTE_ORDER_SIZE = SIZEOF_BYTE; private static final int BYTE_ORDER_SIZE = SIZEOF_BYTE;
private final static int MAJOR_SIZE = SIZEOF_BYTE; private static final int MAJOR_SIZE = SIZEOF_BYTE;
private final static int MINOR_SIZE = SIZEOF_BYTE; private static final int MINOR_SIZE = SIZEOF_BYTE;
private final static int ACCESSIBLE_SIZE = SIZEOF_BYTE; private static final int ACCESSIBLE_SIZE = SIZEOF_BYTE;
private final static int USED_SIZE = SIZEOF_INT; private static final int USED_SIZE = SIZEOF_INT;
private final static int OVERFLOW_SIZE = SIZEOF_INT; private static final int OVERFLOW_SIZE = SIZEOF_INT;
private final static int MOD_TIMESTAMP_SIZE = SIZEOF_LONG; private static final int MOD_TIMESTAMP_SIZE = SIZEOF_LONG;
private final static int ENTRY_OFFSET_SIZE = SIZEOF_INT; private static final int ENTRY_OFFSET_SIZE = SIZEOF_INT;
private final static int NUM_ENTRIES_SIZE = SIZEOF_INT; private static final int NUM_ENTRIES_SIZE = SIZEOF_INT;
// these constants must match the field offsets and sizes // these constants must match the field offsets and sizes
// in the PerfDataPrologue structure in perfMemory.hpp // in the PerfDataPrologue structure in perfMemory.hpp
final static int MAGIC = 0; static final int MAGIC = 0;
final static int BYTE_ORDER = MAGIC + MAGIC_SIZE; static final int BYTE_ORDER = MAGIC + MAGIC_SIZE;
final static int MAJOR_VERSION = BYTE_ORDER + BYTE_ORDER_SIZE; static final int MAJOR_VERSION = BYTE_ORDER + BYTE_ORDER_SIZE;
final static int MINOR_VERSION = MAJOR_VERSION + MAJOR_SIZE; static final int MINOR_VERSION = MAJOR_VERSION + MAJOR_SIZE;
final static int ACCESSIBLE = MINOR_VERSION + MINOR_SIZE; static final int ACCESSIBLE = MINOR_VERSION + MINOR_SIZE;
final static int USED = ACCESSIBLE + ACCESSIBLE_SIZE; static final int USED = ACCESSIBLE + ACCESSIBLE_SIZE;
final static int OVERFLOW = USED + USED_SIZE; static final int OVERFLOW = USED + USED_SIZE;
final static int MOD_TIMESTAMP = OVERFLOW + OVERFLOW_SIZE; static final int MOD_TIMESTAMP = OVERFLOW + OVERFLOW_SIZE;
final static int ENTRY_OFFSET = MOD_TIMESTAMP + MOD_TIMESTAMP_SIZE; static final int ENTRY_OFFSET = MOD_TIMESTAMP + MOD_TIMESTAMP_SIZE;
final static int NUM_ENTRIES = ENTRY_OFFSET + ENTRY_OFFSET_SIZE; static final int NUM_ENTRIES = ENTRY_OFFSET + ENTRY_OFFSET_SIZE;
final static int PROLOGUE_2_0_SIZE = NUM_ENTRIES + NUM_ENTRIES_SIZE; static final int PROLOGUE_2_0_SIZE = NUM_ENTRIES + NUM_ENTRIES_SIZE;
} }

View File

@ -93,14 +93,14 @@ public abstract class Ber {
public static final int ASN_ENUMERATED = 0x0a; public static final int ASN_ENUMERATED = 0x0a;
final static class EncodeException extends IOException { static final class EncodeException extends IOException {
private static final long serialVersionUID = -5247359637775781768L; private static final long serialVersionUID = -5247359637775781768L;
EncodeException(String msg) { EncodeException(String msg) {
super(msg); super(msg);
} }
} }
final static class DecodeException extends IOException { static final class DecodeException extends IOException {
private static final long serialVersionUID = 8735036969244425583L; private static final long serialVersionUID = 8735036969244425583L;
DecodeException(String msg) { DecodeException(String msg) {
super(msg); super(msg);

View File

@ -54,20 +54,20 @@ import javax.net.SocketFactory;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
class ClientId { class ClientId {
final private int version; private final int version;
final private String hostname; private final String hostname;
final private int port; private final int port;
final private String protocol; private final String protocol;
final private Control[] bindCtls; private final Control[] bindCtls;
final private OutputStream trace; private final OutputStream trace;
final private String socketFactory; private final String socketFactory;
final private int myHash; private final int myHash;
final private int ctlHash; private final int ctlHash;
private SocketFactory factory = null; private SocketFactory factory = null;
private Method sockComparator = null; private Method sockComparator = null;
private boolean isDefaultSockFactory = false; private boolean isDefaultSockFactory = false;
final public static boolean debug = false; public static final boolean debug = false;
ClientId(int version, String hostname, int port, String protocol, ClientId(int version, String hostname, int port, String protocol,
Control[] bindCtls, OutputStream trace, String socketFactory) { Control[] bindCtls, OutputStream trace, String socketFactory) {

View File

@ -123,13 +123,13 @@ public final class Connection implements Runnable {
private static final int dump = 0; // > 0 r, > 1 rw private static final int dump = 0; // > 0 r, > 1 rw
final private Thread worker; // Initialized in constructor private final Thread worker; // Initialized in constructor
private boolean v3 = true; // Set in setV3() private boolean v3 = true; // Set in setV3()
final public String host; // used by LdapClient for generating exception messages public final String host; // used by LdapClient for generating exception messages
// used by StartTlsResponse when creating an SSL socket // used by StartTlsResponse when creating an SSL socket
final public int port; // used by LdapClient for generating exception messages public final int port; // used by LdapClient for generating exception messages
// used by StartTlsResponse when creating an SSL socket // used by StartTlsResponse when creating an SSL socket
private boolean bound = false; // Set in setBound() private boolean bound = false; // Set in setBound()
@ -153,7 +153,7 @@ public final class Connection implements Runnable {
// For processing "disconnect" unsolicited notification // For processing "disconnect" unsolicited notification
// Initialized in constructor // Initialized in constructor
final private LdapClient parent; private final LdapClient parent;
// Incremented and returned in sync getMsgId() // Incremented and returned in sync getMsgId()
private int outMsgId = 0; private int outMsgId = 0;

View File

@ -58,8 +58,8 @@ class DigestClientId extends SimpleClientId {
"javax.security.sasl.policy.credentials", "javax.security.sasl.policy.credentials",
}; };
final private String[] propvals; private final String[] propvals;
final private int myHash; private final int myHash;
DigestClientId(int version, String hostname, int port, DigestClientId(int version, String hostname, int port,
String protocol, Control[] bindCtls, OutputStream trace, String protocol, Control[] bindCtls, OutputStream trace,

View File

@ -54,7 +54,7 @@ import javax.naming.directory.*;
* @see com.sun.jndi.ldap.ctl.ResponseControlFactory ResponseControlFactory * @see com.sun.jndi.ldap.ctl.ResponseControlFactory ResponseControlFactory
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class EntryChangeResponseControl extends BasicControl { public final class EntryChangeResponseControl extends BasicControl {
/** /**
* The entry-change response control's assigned object identifier * The entry-change response control's assigned object identifier

View File

@ -45,7 +45,7 @@ import javax.naming.ldap.UnsolicitedNotificationListener;
* @author Rosanna Lee (modified for JNDI-related events) * @author Rosanna Lee (modified for JNDI-related events)
*/ */
final class EventQueue implements Runnable { final class EventQueue implements Runnable {
final static private boolean debug = false; private static final boolean debug = false;
private static class QueueElement { private static class QueueElement {
QueueElement next = null; QueueElement next = null;

View File

@ -113,7 +113,7 @@ import javax.naming.ldap.UnsolicitedNotification;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
final class EventSupport { final class EventSupport {
final static private boolean debug = false; private static final boolean debug = false;
private LdapCtx ctx; private LdapCtx ctx;

View File

@ -118,8 +118,8 @@ public final class LdapClient implements PooledConnection {
final Connection conn; // Connection to server; has reader thread final Connection conn; // Connection to server; has reader thread
// used by LdapCtx for StartTLS // used by LdapCtx for StartTLS
final private PoolCallback pcb; private final PoolCallback pcb;
final private boolean pooled; private final boolean pooled;
private boolean authenticateCalled = false; private boolean authenticateCalled = false;
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////

View File

@ -42,12 +42,12 @@ import com.sun.jndi.ldap.pool.PooledConnectionFactory;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
final class LdapClientFactory implements PooledConnectionFactory { final class LdapClientFactory implements PooledConnectionFactory {
final private String host; private final String host;
final private int port; private final int port;
final private String socketFactory; private final String socketFactory;
final private int connTimeout; private final int connTimeout;
final private int readTimeout; private final int readTimeout;
final private OutputStream trace; private final OutputStream trace;
LdapClientFactory(String host, int port, String socketFactory, LdapClientFactory(String host, int port, String socketFactory,
int connTimeout, int readTimeout, OutputStream trace) { int connTimeout, int readTimeout, OutputStream trace) {

View File

@ -96,13 +96,13 @@ import com.sun.jndi.ldap.ext.StartTlsResponseImpl;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
final public class LdapCtx extends ComponentDirContext public final class LdapCtx extends ComponentDirContext
implements EventDirContext, LdapContext { implements EventDirContext, LdapContext {
/* /*
* Used to store arguments to the search method. * Used to store arguments to the search method.
*/ */
final static class SearchArgs { static final class SearchArgs {
Name name; Name name;
String filter; String filter;
SearchControls cons; SearchControls cons;

View File

@ -38,11 +38,11 @@ import javax.naming.ldap.Control;
import com.sun.jndi.url.ldap.ldapURLContextFactory; import com.sun.jndi.url.ldap.ldapURLContextFactory;
final public class LdapCtxFactory implements ObjectFactory, InitialContextFactory { public final class LdapCtxFactory implements ObjectFactory, InitialContextFactory {
/** /**
* The type of each address in an LDAP reference. * The type of each address in an LDAP reference.
*/ */
public final static String ADDRESS_TYPE = "URL"; public static final String ADDRESS_TYPE = "URL";
// ----------------- ObjectFactory interface -------------------- // ----------------- ObjectFactory interface --------------------

View File

@ -64,7 +64,7 @@ import java.util.Vector;
* *
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class LdapReferralException extends public final class LdapReferralException extends
javax.naming.ldap.LdapReferralException { javax.naming.ldap.LdapReferralException {
private static final long serialVersionUID = 627059076356906399L; private static final long serialVersionUID = 627059076356906399L;

View File

@ -34,9 +34,9 @@ import java.util.concurrent.TimeUnit;
final class LdapRequest { final class LdapRequest {
private final static BerDecoder EOF = new BerDecoder(new byte[]{}, -1, 0); private static final BerDecoder EOF = new BerDecoder(new byte[]{}, -1, 0);
private final static String CLOSE_MSG = "LDAP connection has been closed"; private static final String CLOSE_MSG = "LDAP connection has been closed";
private final static String TIMEOUT_MSG_FMT = "LDAP response read timed out, timeout used: %d ms."; private static final String TIMEOUT_MSG_FMT = "LDAP response read timed out, timeout used: %d ms.";
LdapRequest next; // Set/read in synchronized Connection methods LdapRequest next; // Set/read in synchronized Connection methods
final int msgId; // read-only final int msgId; // read-only

View File

@ -43,7 +43,7 @@ import com.sun.jndi.toolkit.dir.HierMemDirCtx;
final class LdapSchemaCtx extends HierMemDirCtx { final class LdapSchemaCtx extends HierMemDirCtx {
static private final boolean debug = false; private static final boolean debug = false;
private static final int LEAF = 0; // schema object (e.g. attribute type defn) private static final int LEAF = 0; // schema object (e.g. attribute type defn)
private static final int SCHEMA_ROOT = 1; // schema tree root private static final int SCHEMA_ROOT = 1; // schema tree root
@ -96,7 +96,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
// override to ignore obj and use attrs // override to ignore obj and use attrs
// treat same as createSubcontext // treat same as createSubcontext
final public void bind(Name name, Object obj, Attributes attrs) public final void bind(Name name, Object obj, Attributes attrs)
throws NamingException { throws NamingException {
if (!setupMode) { if (!setupMode) {
if (obj != null) { if (obj != null) {
@ -112,7 +112,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
(LdapSchemaCtx)super.doCreateSubcontext(name, attrs); (LdapSchemaCtx)super.doCreateSubcontext(name, attrs);
} }
final protected void doBind(Name name, Object obj, Attributes attrs, protected final void doBind(Name name, Object obj, Attributes attrs,
boolean useFactory) throws NamingException { boolean useFactory) throws NamingException {
if (!setupMode) { if (!setupMode) {
throw new SchemaViolationException( throw new SchemaViolationException(
@ -123,7 +123,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
} }
// override to use bind() instead // override to use bind() instead
final public void rebind(Name name, Object obj, Attributes attrs) public final void rebind(Name name, Object obj, Attributes attrs)
throws NamingException { throws NamingException {
try { try {
doLookup(name, false); doLookup(name, false);
@ -134,7 +134,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
} }
} }
final protected void doRebind(Name name, Object obj, Attributes attrs, protected final void doRebind(Name name, Object obj, Attributes attrs,
boolean useFactory) throws NamingException { boolean useFactory) throws NamingException {
if (!setupMode) { if (!setupMode) {
throw new SchemaViolationException( throw new SchemaViolationException(
@ -144,7 +144,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
} }
} }
final protected void doUnbind(Name name) throws NamingException { protected final void doUnbind(Name name) throws NamingException {
if (!setupMode) { if (!setupMode) {
// Update server // Update server
try { try {
@ -160,7 +160,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
super.doUnbind(name); super.doUnbind(name);
} }
final protected void doRename(Name oldname, Name newname) protected final void doRename(Name oldname, Name newname)
throws NamingException { throws NamingException {
if (!setupMode) { if (!setupMode) {
throw new SchemaViolationException("Cannot rename a schema object"); throw new SchemaViolationException("Cannot rename a schema object");
@ -169,7 +169,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
} }
} }
final protected void doDestroySubcontext(Name name) throws NamingException { protected final void doDestroySubcontext(Name name) throws NamingException {
if (!setupMode) { if (!setupMode) {
// Update server // Update server
try { try {
@ -203,7 +203,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
} }
} }
final protected DirContext doCreateSubcontext(Name name, Attributes attrs) protected final DirContext doCreateSubcontext(Name name, Attributes attrs)
throws NamingException { throws NamingException {
if (attrs == null || attrs.size() == 0) { if (attrs == null || attrs.size() == 0) {
@ -222,7 +222,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
return newEntry; return newEntry;
} }
final private static Attributes deepClone(Attributes orig) private static final Attributes deepClone(Attributes orig)
throws NamingException { throws NamingException {
BasicAttributes copy = new BasicAttributes(true); BasicAttributes copy = new BasicAttributes(true);
NamingEnumeration<? extends Attribute> attrs = orig.getAll(); NamingEnumeration<? extends Attribute> attrs = orig.getAll();
@ -232,7 +232,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
return copy; return copy;
} }
final protected void doModifyAttributes(ModificationItem[] mods) protected final void doModifyAttributes(ModificationItem[] mods)
throws NamingException { throws NamingException {
if (setupMode) { if (setupMode) {
super.doModifyAttributes(mods); super.doModifyAttributes(mods);
@ -253,13 +253,13 @@ final class LdapSchemaCtx extends HierMemDirCtx {
// we override this so the superclass creates the right kind of contexts // we override this so the superclass creates the right kind of contexts
// Default is to create LEAF objects; caller will change after creation // Default is to create LEAF objects; caller will change after creation
// if necessary // if necessary
final protected HierMemDirCtx createNewCtx() { protected final HierMemDirCtx createNewCtx() {
LdapSchemaCtx ctx = new LdapSchemaCtx(LEAF, myEnv, info); LdapSchemaCtx ctx = new LdapSchemaCtx(LEAF, myEnv, info);
return ctx; return ctx;
} }
final private void addServerSchema(Attributes attrs) private final void addServerSchema(Attributes attrs)
throws NamingException { throws NamingException {
Attribute schemaAttr; Attribute schemaAttr;
@ -304,7 +304,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
* on the server and there might not be any checks for extra spaces * on the server and there might not be any checks for extra spaces
* or parens. * or parens.
*/ */
final private void deleteServerSchema(Attributes origAttrs) private final void deleteServerSchema(Attributes origAttrs)
throws NamingException { throws NamingException {
Attribute origAttrVal; Attribute origAttrVal;
@ -347,7 +347,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
* are eliminated. A modification is done by deleting the original * are eliminated. A modification is done by deleting the original
* value and adding a new value with the modification. * value and adding a new value with the modification.
*/ */
final private void modifyServerSchema(Attributes origAttrs, private final void modifyServerSchema(Attributes origAttrs,
Attributes newAttrs) throws NamingException { Attributes newAttrs) throws NamingException {
Attribute newAttrVal; Attribute newAttrVal;
@ -386,7 +386,7 @@ final class LdapSchemaCtx extends HierMemDirCtx {
info.modifyAttributes(myEnv, mods); info.modifyAttributes(myEnv, mods);
} }
final static private class SchemaInfo { private static final class SchemaInfo {
private LdapCtx schemaEntry; private LdapCtx schemaEntry;
private String schemaEntryName; private String schemaEntryName;
LdapSchemaParser parser; LdapSchemaParser parser;

View File

@ -108,7 +108,7 @@ final class LdapSchemaParser {
this.netscapeBug = netscapeBug; this.netscapeBug = netscapeBug;
} }
final static void LDAP2JNDISchema(Attributes schemaAttrs, static final void LDAP2JNDISchema(Attributes schemaAttrs,
LdapSchemaCtx schemaRoot) throws NamingException { LdapSchemaCtx schemaRoot) throws NamingException {
Attribute objectClassesAttr = null; Attribute objectClassesAttr = null;
Attribute attributeDefAttr = null; Attribute attributeDefAttr = null;
@ -136,7 +136,7 @@ final class LdapSchemaParser {
} }
} }
final private static DirContext objectDescs2ClassDefs(Attribute objDescsAttr, private static final DirContext objectDescs2ClassDefs(Attribute objDescsAttr,
LdapSchemaCtx schemaRoot) LdapSchemaCtx schemaRoot)
throws NamingException { throws NamingException {
@ -168,7 +168,7 @@ final class LdapSchemaParser {
return classDefTree; return classDefTree;
} }
final private static DirContext attrDescs2AttrDefs(Attribute attributeDescAttr, private static final DirContext attrDescs2AttrDefs(Attribute attributeDescAttr,
LdapSchemaCtx schemaRoot) LdapSchemaCtx schemaRoot)
throws NamingException { throws NamingException {
@ -200,7 +200,7 @@ final class LdapSchemaParser {
return attrDefTree; return attrDefTree;
} }
final private static DirContext syntaxDescs2SyntaxDefs( private static final DirContext syntaxDescs2SyntaxDefs(
Attribute syntaxDescAttr, Attribute syntaxDescAttr,
LdapSchemaCtx schemaRoot) LdapSchemaCtx schemaRoot)
throws NamingException { throws NamingException {
@ -233,7 +233,7 @@ final class LdapSchemaParser {
return syntaxDefTree; return syntaxDefTree;
} }
final private static DirContext matchRuleDescs2MatchRuleDefs( private static final DirContext matchRuleDescs2MatchRuleDefs(
Attribute matchRuleDescAttr, Attribute matchRuleDescAttr,
LdapSchemaCtx schemaRoot) LdapSchemaCtx schemaRoot)
throws NamingException { throws NamingException {
@ -266,7 +266,7 @@ final class LdapSchemaParser {
return matchRuleDefTree; return matchRuleDefTree;
} }
final private static Object[] desc2Def(String desc) private static final Object[] desc2Def(String desc)
throws NamingException { throws NamingException {
//System.err.println(desc); //System.err.println(desc);
@ -302,7 +302,7 @@ final class LdapSchemaParser {
// returns the index of the first whitespace char of a linear whitespace // returns the index of the first whitespace char of a linear whitespace
// sequence ending at the given position. // sequence ending at the given position.
final private static int findTrailingWhitespace(String string, int pos) { private static final int findTrailingWhitespace(String string, int pos) {
for(int i = pos; i > 0; i--) { for(int i = pos; i > 0; i--) {
if(string.charAt(i) != WHSP) { if(string.charAt(i) != WHSP) {
return i + 1; return i + 1;
@ -311,7 +311,7 @@ final class LdapSchemaParser {
return 0; return 0;
} }
final private static void skipWhitespace(String string, int[] pos) { private static final void skipWhitespace(String string, int[] pos) {
for(int i=pos[0]; i < string.length(); i++) { for(int i=pos[0]; i < string.length(); i++) {
if(string.charAt(i) != WHSP) { if(string.charAt(i) != WHSP) {
pos[0] = i; pos[0] = i;
@ -323,7 +323,7 @@ final class LdapSchemaParser {
} }
} }
final private static Attribute readNumericOID(String string, int[] pos) private static final Attribute readNumericOID(String string, int[] pos)
throws NamingException { throws NamingException {
if (debug) { if (debug) {
@ -350,7 +350,7 @@ final class LdapSchemaParser {
return new BasicAttribute(NUMERICOID_ID, value); return new BasicAttribute(NUMERICOID_ID, value);
} }
final private static Attribute readNextTag(String string, int[] pos) private static final Attribute readNextTag(String string, int[] pos)
throws NamingException { throws NamingException {
Attribute attr = null; Attribute attr = null;
@ -393,7 +393,7 @@ final class LdapSchemaParser {
return attr; return attr;
} }
final private static String[] readTag(String tag, String string, int[] pos) private static final String[] readTag(String tag, String string, int[] pos)
throws NamingException { throws NamingException {
if (debug) { if (debug) {
@ -441,7 +441,7 @@ final class LdapSchemaParser {
return readQDStrings(string, pos); return readQDStrings(string, pos);
} }
final private static String[] readQDString(String string, int[] pos) private static final String[] readQDString(String string, int[] pos)
throws NamingException { throws NamingException {
int begin, end; int begin, end;
@ -477,7 +477,7 @@ final class LdapSchemaParser {
* qdstringlist = [ qdstring *( qdstring ) ] * qdstringlist = [ qdstring *( qdstring ) ]
* qdstrings = qdstring / ( whsp "(" qdstringlist ")" whsp ) * qdstrings = qdstring / ( whsp "(" qdstringlist ")" whsp )
*/ */
private final static String[] readQDStrings(String string, int[] pos) private static final String[] readQDStrings(String string, int[] pos)
throws NamingException { throws NamingException {
return readQDescrs(string, pos); return readQDescrs(string, pos);
@ -490,7 +490,7 @@ final class LdapSchemaParser {
* qdescr = whsp "'" descr "'" whsp * qdescr = whsp "'" descr "'" whsp
* descr = keystring * descr = keystring
*/ */
final private static String[] readQDescrs(String string, int[] pos) private static final String[] readQDescrs(String string, int[] pos)
throws NamingException { throws NamingException {
if (debug) { if (debug) {
@ -515,7 +515,7 @@ final class LdapSchemaParser {
* qdescr = whsp "'" descr "'" whsp * qdescr = whsp "'" descr "'" whsp
* descr = keystring * descr = keystring
*/ */
final private static String[] readQDescrList(String string, int[] pos) private static final String[] readQDescrList(String string, int[] pos)
throws NamingException { throws NamingException {
int begin, end; int begin, end;
@ -557,7 +557,7 @@ final class LdapSchemaParser {
return answer; return answer;
} }
final private static String[] readWOID(String string, int[] pos) private static final String[] readWOID(String string, int[] pos)
throws NamingException { throws NamingException {
if (debug) { if (debug) {
@ -595,7 +595,7 @@ final class LdapSchemaParser {
* oids = woid / ( "(" oidlist ")" ) * oids = woid / ( "(" oidlist ")" )
* oidlist = woid *( "$" woid ) * oidlist = woid *( "$" woid )
*/ */
final private static String[] readOIDs(String string, int[] pos) private static final String[] readOIDs(String string, int[] pos)
throws NamingException { throws NamingException {
if (debug) { if (debug) {
@ -764,7 +764,7 @@ final class LdapSchemaParser {
* Translate attributes that describe an object class into the * Translate attributes that describe an object class into the
* string description as defined in RFC 2252. * string description as defined in RFC 2252.
*/ */
final private String classDef2ObjectDesc(Attributes attrs) private final String classDef2ObjectDesc(Attributes attrs)
throws NamingException { throws NamingException {
StringBuilder objectDesc = new StringBuilder("( "); StringBuilder objectDesc = new StringBuilder("( ");
@ -876,7 +876,7 @@ final class LdapSchemaParser {
* Translate attributes that describe an attribute definition into the * Translate attributes that describe an attribute definition into the
* string description as defined in RFC 2252. * string description as defined in RFC 2252.
*/ */
final private String attrDef2AttrDesc(Attributes attrs) private final String attrDef2AttrDesc(Attributes attrs)
throws NamingException { throws NamingException {
StringBuilder attrDesc = new StringBuilder("( "); // opening parens StringBuilder attrDesc = new StringBuilder("( "); // opening parens
@ -1009,7 +1009,7 @@ final class LdapSchemaParser {
* Translate attributes that describe an attribute syntax definition into the * Translate attributes that describe an attribute syntax definition into the
* string description as defined in RFC 2252. * string description as defined in RFC 2252.
*/ */
final private String syntaxDef2SyntaxDesc(Attributes attrs) private final String syntaxDef2SyntaxDesc(Attributes attrs)
throws NamingException { throws NamingException {
StringBuilder syntaxDesc = new StringBuilder("( "); // opening parens StringBuilder syntaxDesc = new StringBuilder("( "); // opening parens
@ -1065,7 +1065,7 @@ final class LdapSchemaParser {
* Translate attributes that describe an attribute matching rule * Translate attributes that describe an attribute matching rule
* definition into the string description as defined in RFC 2252. * definition into the string description as defined in RFC 2252.
*/ */
final private String matchRuleDef2MatchRuleDesc(Attributes attrs) private final String matchRuleDef2MatchRuleDesc(Attributes attrs)
throws NamingException { throws NamingException {
StringBuilder matchRuleDesc = new StringBuilder("( "); // opening parens StringBuilder matchRuleDesc = new StringBuilder("( "); // opening parens
@ -1141,7 +1141,7 @@ final class LdapSchemaParser {
return matchRuleDesc.toString(); return matchRuleDesc.toString();
} }
final private String writeNumericOID(Attribute nOIDAttr) private final String writeNumericOID(Attribute nOIDAttr)
throws NamingException { throws NamingException {
if(nOIDAttr.size() != 1) { if(nOIDAttr.size() != 1) {
throw new InvalidAttributeValueException( throw new InvalidAttributeValueException(
@ -1150,7 +1150,7 @@ final class LdapSchemaParser {
return (String)(nOIDAttr.get()) + WHSP; return (String)(nOIDAttr.get()) + WHSP;
} }
final private String writeWOID(Attribute attr) throws NamingException { private final String writeWOID(Attribute attr) throws NamingException {
if (netscapeBug) if (netscapeBug)
return writeQDString(attr); return writeQDString(attr);
else else
@ -1158,7 +1158,7 @@ final class LdapSchemaParser {
} }
/* qdescr = whsp "'" descr "'" whsp */ /* qdescr = whsp "'" descr "'" whsp */
final private String writeQDString(Attribute qdStringAttr) private final String writeQDString(Attribute qdStringAttr)
throws NamingException { throws NamingException {
if(qdStringAttr.size() != 1) { if(qdStringAttr.size() != 1) {
throw new InvalidAttributeValueException( throw new InvalidAttributeValueException(
@ -1216,7 +1216,7 @@ final class LdapSchemaParser {
return qdList.toString(); return qdList.toString();
} }
final private String writeOIDs(Attribute oidsAttr) private final String writeOIDs(Attribute oidsAttr)
throws NamingException { throws NamingException {
switch(oidsAttr.size()) { switch(oidsAttr.size()) {

View File

@ -62,7 +62,7 @@ import com.sun.jndi.toolkit.url.UrlUtil;
* This class also supports ldaps URLs. * This class also supports ldaps URLs.
*/ */
final public class LdapURL extends Uri { public final class LdapURL extends Uri {
private boolean useSsl = false; private boolean useSsl = false;
private String DN = null; private String DN = null;

View File

@ -36,7 +36,7 @@ import java.io.IOException;
* *
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class ManageReferralControl extends BasicControl { public final class ManageReferralControl extends BasicControl {
/** /**
* The manage referral control's assigned object identifier * The manage referral control's assigned object identifier

View File

@ -48,7 +48,7 @@ import com.sun.jndi.toolkit.ctx.Continuation;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
final class NamingEventNotifier implements Runnable { final class NamingEventNotifier implements Runnable {
private final static boolean debug = false; private static final boolean debug = false;
private Vector<NamingListener> namingListeners; private Vector<NamingListener> namingListeners;
private Thread worker; private Thread worker;

View File

@ -46,7 +46,7 @@ import java.io.IOException;
* @see EntryChangeResponseControl * @see EntryChangeResponseControl
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class PersistentSearchControl extends BasicControl { public final class PersistentSearchControl extends BasicControl {
/** /**
* The persistent search control's assigned object identifier * The persistent search control's assigned object identifier

View File

@ -37,9 +37,9 @@ import javax.naming.ldap.Control;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
class SimpleClientId extends ClientId { class SimpleClientId extends ClientId {
final private String username; private final String username;
final private Object passwd; private final Object passwd;
final private int myHash; private final int myHash;
SimpleClientId(int version, String hostname, int port, SimpleClientId(int version, String hostname, int port,
String protocol, Control[] bindCtls, OutputStream trace, String protocol, Control[] bindCtls, OutputStream trace,

View File

@ -60,7 +60,7 @@ import com.sun.jndi.ldap.Connection;
* @see StartTlsRequest * @see StartTlsRequest
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class StartTlsResponseImpl extends StartTlsResponse { public final class StartTlsResponseImpl extends StartTlsResponse {
private static final boolean debug = false; private static final boolean debug = false;

View File

@ -34,14 +34,14 @@ package com.sun.jndi.ldap.pool;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
final class ConnectionDesc { final class ConnectionDesc {
private final static boolean debug = Pool.debug; private static final boolean debug = Pool.debug;
// Package private because used by Pool.showStats() // Package private because used by Pool.showStats()
static final byte BUSY = (byte)0; static final byte BUSY = (byte)0;
static final byte IDLE = (byte)1; static final byte IDLE = (byte)1;
static final byte EXPIRED = (byte)2; static final byte EXPIRED = (byte)2;
final private PooledConnection conn; private final PooledConnection conn;
private byte state = IDLE; // initial state private byte state = IDLE; // initial state
private long idleSince; private long idleSince;

View File

@ -68,9 +68,9 @@ final class Connections implements PoolCallback {
com.sun.jndi.ldap.LdapPoolManager.trace; com.sun.jndi.ldap.LdapPoolManager.trace;
private static final int DEFAULT_SIZE = 10; private static final int DEFAULT_SIZE = 10;
final private int maxSize; private final int maxSize;
final private int prefSize; private final int prefSize;
final private List<ConnectionDesc> conns; private final List<ConnectionDesc> conns;
private boolean closed = false; // Closed for business private boolean closed = false; // Closed for business
private Reference<Object> ref; // maintains reference to id to prevent premature GC private Reference<Object> ref; // maintains reference to id to prevent premature GC

View File

@ -46,7 +46,7 @@ package com.sun.jndi.ldap.pool;
* when they are returned to the pool. * when they are returned to the pool.
*/ */
final class ConnectionsRef { final class ConnectionsRef {
final private Connections conns; private final Connections conns;
ConnectionsRef(Connections conns) { ConnectionsRef(Connections conns) {
this.conns = conns; this.conns = conns;

View File

@ -75,7 +75,7 @@ import javax.naming.NamingException;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
final public class Pool { public final class Pool {
static final boolean debug = com.sun.jndi.ldap.LdapPoolManager.debug; static final boolean debug = com.sun.jndi.ldap.LdapPoolManager.debug;
@ -87,10 +87,10 @@ final public class Pool {
private static final Collection<Reference<ConnectionsRef>> weakRefs = private static final Collection<Reference<ConnectionsRef>> weakRefs =
Collections.synchronizedList(new LinkedList<Reference<ConnectionsRef>>()); Collections.synchronizedList(new LinkedList<Reference<ConnectionsRef>>());
final private int maxSize; // max num of identical conn per pool private final int maxSize; // max num of identical conn per pool
final private int prefSize; // preferred num of identical conn per pool private final int prefSize; // preferred num of identical conn per pool
final private int initSize; // initial number of identical conn to create private final int initSize; // initial number of identical conn to create
final private Map<Object, ConnectionsRef> map; private final Map<Object, ConnectionsRef> map;
public Pool(int initSize, int prefSize, int maxSize) { public Pool(int initSize, int prefSize, int maxSize) {
map = new WeakHashMap<>(); map = new WeakHashMap<>();

View File

@ -30,9 +30,9 @@ package com.sun.jndi.ldap.pool;
* *
* @author Rosanna Lee * @author Rosanna Lee
*/ */
final public class PoolCleaner implements Runnable { public final class PoolCleaner implements Runnable {
final private Pool[] pools; private final Pool[] pools;
final private long period; private final long period;
/** /**
* @param period ms to wait between cleaning * @param period ms to wait between cleaning

View File

@ -51,7 +51,7 @@ import com.sun.jndi.ldap.sasl.TlsChannelBinding.TlsChannelBindingType;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
final public class LdapSasl { public final class LdapSasl {
// SASL stuff // SASL stuff
private static final String SASL_CALLBACK = "java.naming.security.sasl.callback"; private static final String SASL_CALLBACK = "java.naming.security.sasl.callback";
private static final String SASL_AUTHZ_ID = private static final String SASL_AUTHZ_ID =

View File

@ -73,7 +73,7 @@ public class TlsChannelBinding {
return name; return name;
} }
final private String name; private final String name;
TlsChannelBindingType(String name) { TlsChannelBindingType(String name) {
this.name = name; this.name = name;
} }
@ -98,8 +98,8 @@ public class TlsChannelBinding {
return null; return null;
} }
final private TlsChannelBindingType cbType; private final TlsChannelBindingType cbType;
final private byte[] cbData; private final byte[] cbData;
/** /**
* Construct tls-server-end-point Channel Binding data * Construct tls-server-end-point Channel Binding data

View File

@ -39,7 +39,7 @@ import java.util.*;
public class HierMemDirCtx implements DirContext { public class HierMemDirCtx implements DirContext {
static private final boolean debug = false; private static final boolean debug = false;
private static final NameParser defaultParser = new HierarchicalNameParser(); private static final NameParser defaultParser = new HierarchicalNameParser();
protected Hashtable<String, Object> myEnv; protected Hashtable<String, Object> myEnv;

View File

@ -47,7 +47,7 @@ import javax.naming.spi.DirectoryManager;
import java.util.NoSuchElementException; import java.util.NoSuchElementException;
import java.util.Hashtable; import java.util.Hashtable;
final public class LazySearchEnumerationImpl public final class LazySearchEnumerationImpl
implements NamingEnumeration<SearchResult> { implements NamingEnumeration<SearchResult> {
private NamingEnumeration<Binding> candidates; private NamingEnumeration<Binding> candidates;
private SearchResult nextMatch = null; private SearchResult nextMatch = null;

View File

@ -47,7 +47,7 @@ import java.net.MalformedURLException;
* @author Scott Seligman * @author Scott Seligman
* @author Rosanna Lee * @author Rosanna Lee
*/ */
abstract public class GenericURLContext implements Context { public abstract class GenericURLContext implements Context {
protected Hashtable<String, Object> myEnv = null; protected Hashtable<String, Object> myEnv = null;
@SuppressWarnings("unchecked") // Expect Hashtable<String, Object> @SuppressWarnings("unchecked") // Expect Hashtable<String, Object>
@ -76,7 +76,7 @@ abstract public class GenericURLContext implements Context {
* getRootURLContext(), getURLPrefix(), and getURLSuffix() * getRootURLContext(), getURLPrefix(), and getURLSuffix()
* must be in sync wrt how URLs are parsed and returned. * must be in sync wrt how URLs are parsed and returned.
*/ */
abstract protected ResolveResult getRootURLContext(String url, protected abstract ResolveResult getRootURLContext(String url,
Hashtable<?,?> env) throws NamingException; Hashtable<?,?> env) throws NamingException;
/** /**

View File

@ -47,7 +47,7 @@ import java.util.Hashtable;
* @author Rosanna Lee * @author Rosanna Lee
*/ */
abstract public class GenericURLDirContext extends GenericURLContext public abstract class GenericURLDirContext extends GenericURLContext
implements DirContext { implements DirContext {
protected GenericURLDirContext(Hashtable<?,?> env) { protected GenericURLDirContext(Hashtable<?,?> env) {

View File

@ -34,7 +34,7 @@ import java.net.URLDecoder;
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class UrlUtil { public final class UrlUtil {
// To prevent creation of this static class // To prevent creation of this static class
private UrlUtil() { private UrlUtil() {

View File

@ -39,7 +39,7 @@ import com.sun.jndi.ldap.LdapURL;
* @author Scott Seligman * @author Scott Seligman
*/ */
final public class ldapURLContext public final class ldapURLContext
extends com.sun.jndi.toolkit.url.GenericURLDirContext { extends com.sun.jndi.toolkit.url.GenericURLDirContext {
ldapURLContext(Hashtable<?,?> env) { ldapURLContext(Hashtable<?,?> env) {

View File

@ -33,5 +33,5 @@ import com.sun.jndi.url.ldap.*;
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class ldapsURLContextFactory extends ldapURLContextFactory { public final class ldapsURLContextFactory extends ldapURLContextFactory {
} }

View File

@ -67,7 +67,7 @@ public final class VersionHelper {
TRUST_URL_CODE_BASE = "true".equalsIgnoreCase(trust); TRUST_URL_CODE_BASE = "true".equalsIgnoreCase(trust);
} }
final static String[] PROPS = new String[]{ static final String[] PROPS = new String[]{
javax.naming.Context.INITIAL_CONTEXT_FACTORY, javax.naming.Context.INITIAL_CONTEXT_FACTORY,
javax.naming.Context.OBJECT_FACTORIES, javax.naming.Context.OBJECT_FACTORIES,
javax.naming.Context.URL_PKG_PREFIXES, javax.naming.Context.URL_PKG_PREFIXES,
@ -78,13 +78,13 @@ public final class VersionHelper {
javax.naming.ldap.LdapContext.CONTROL_FACTORIES javax.naming.ldap.LdapContext.CONTROL_FACTORIES
}; };
public final static int INITIAL_CONTEXT_FACTORY = 0; public static final int INITIAL_CONTEXT_FACTORY = 0;
public final static int OBJECT_FACTORIES = 1; public static final int OBJECT_FACTORIES = 1;
public final static int URL_PKG_PREFIXES = 2; public static final int URL_PKG_PREFIXES = 2;
public final static int STATE_FACTORIES = 3; public static final int STATE_FACTORIES = 3;
public final static int PROVIDER_URL = 4; public static final int PROVIDER_URL = 4;
public final static int DNS_URL = 5; public static final int DNS_URL = 5;
public final static int CONTROL_FACTORIES = 6; public static final int CONTROL_FACTORIES = 6;
private VersionHelper() {} // Disallow anyone from creating one of these. private VersionHelper() {} // Disallow anyone from creating one of these.

View File

@ -259,7 +259,7 @@ public interface DirContext extends Context {
* @see ModificationItem * @see ModificationItem
* @see #modifyAttributes * @see #modifyAttributes
*/ */
public final static int ADD_ATTRIBUTE = 1; public static final int ADD_ATTRIBUTE = 1;
/** /**
* This constant specifies to replace an attribute with specified values. * This constant specifies to replace an attribute with specified values.
@ -278,7 +278,7 @@ public interface DirContext extends Context {
* @see ModificationItem * @see ModificationItem
* @see #modifyAttributes * @see #modifyAttributes
*/ */
public final static int REPLACE_ATTRIBUTE = 2; public static final int REPLACE_ATTRIBUTE = 2;
/** /**
* This constant specifies to delete * This constant specifies to delete
@ -299,7 +299,7 @@ public interface DirContext extends Context {
* @see ModificationItem * @see ModificationItem
* @see #modifyAttributes * @see #modifyAttributes
*/ */
public final static int REMOVE_ATTRIBUTE = 3; public static final int REMOVE_ATTRIBUTE = 3;
/** /**
* Modifies the attributes associated with a named object. * Modifies the attributes associated with a named object.

View File

@ -56,7 +56,7 @@ public class SearchControls implements java.io.Serializable {
* <p> * <p>
* The value of this constant is {@code 0}. * The value of this constant is {@code 0}.
*/ */
public final static int OBJECT_SCOPE = 0; public static final int OBJECT_SCOPE = 0;
/** /**
* Search one level of the named context. * Search one level of the named context.
@ -70,7 +70,7 @@ public class SearchControls implements java.io.Serializable {
* <p> * <p>
* The value of this constant is {@code 1}. * The value of this constant is {@code 1}.
*/ */
public final static int ONELEVEL_SCOPE = 1; public static final int ONELEVEL_SCOPE = 1;
/** /**
* Search the entire subtree rooted at the named object. * Search the entire subtree rooted at the named object.
*<p> *<p>
@ -92,7 +92,7 @@ public class SearchControls implements java.io.Serializable {
* <p> * <p>
* The value of this constant is {@code 2}. * The value of this constant is {@code 2}.
*/ */
public final static int SUBTREE_SCOPE = 2; public static final int SUBTREE_SCOPE = 2;
/** /**
* Contains the scope with which to apply the search. One of * Contains the scope with which to apply the search. One of

View File

@ -140,7 +140,7 @@ public interface EventContext extends Context {
*<p> *<p>
* The value of this constant is {@code 0}. * The value of this constant is {@code 0}.
*/ */
public final static int OBJECT_SCOPE = 0; public static final int OBJECT_SCOPE = 0;
/** /**
* Constant for expressing interest in events concerning objects * Constant for expressing interest in events concerning objects
@ -149,7 +149,7 @@ public interface EventContext extends Context {
*<p> *<p>
* The value of this constant is {@code 1}. * The value of this constant is {@code 1}.
*/ */
public final static int ONELEVEL_SCOPE = 1; public static final int ONELEVEL_SCOPE = 1;
/** /**
* Constant for expressing interest in events concerning objects * Constant for expressing interest in events concerning objects
@ -158,7 +158,7 @@ public interface EventContext extends Context {
*<p> *<p>
* The value of this constant is {@code 2}. * The value of this constant is {@code 2}.
*/ */
public final static int SUBTREE_SCOPE = 2; public static final int SUBTREE_SCOPE = 2;
/** /**

View File

@ -39,7 +39,7 @@ package javax.naming.ldap;
* @since 1.5 * @since 1.5
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class ManageReferralControl extends BasicControl { public final class ManageReferralControl extends BasicControl {
/** /**
* The ManageReferral control's assigned object identifier * The ManageReferral control's assigned object identifier

View File

@ -110,7 +110,7 @@ import com.sun.jndi.ldap.BerEncoder;
* @see PagedResultsResponseControl * @see PagedResultsResponseControl
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class PagedResultsControl extends BasicControl { public final class PagedResultsControl extends BasicControl {
/** /**
* The paged-results control's assigned object identifier * The paged-results control's assigned object identifier

View File

@ -58,7 +58,7 @@ import com.sun.jndi.ldap.BerDecoder;
* @see PagedResultsControl * @see PagedResultsControl
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class PagedResultsResponseControl extends BasicControl { public final class PagedResultsResponseControl extends BasicControl {
/** /**
* The paged-results response control's assigned object identifier * The paged-results response control's assigned object identifier

View File

@ -106,7 +106,7 @@ import com.sun.jndi.ldap.BerEncoder;
* @see SortResponseControl * @see SortResponseControl
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class SortControl extends BasicControl { public final class SortControl extends BasicControl {
/** /**
* The server-side sort control's assigned object identifier * The server-side sort control's assigned object identifier

View File

@ -77,7 +77,7 @@ import com.sun.jndi.ldap.LdapCtx;
* @see SortControl * @see SortControl
* @author Vincent Ryan * @author Vincent Ryan
*/ */
final public class SortResponseControl extends BasicControl { public final class SortResponseControl extends BasicControl {
/** /**
* The server-side sort response control's assigned object identifier * The server-side sort response control's assigned object identifier

View File

@ -229,7 +229,7 @@ public class StartTlsRequest implements ExtendedRequest {
); );
} }
private final static boolean privilegedHasNext(final Iterator<StartTlsResponse> iter) { private static final boolean privilegedHasNext(final Iterator<StartTlsResponse> iter) {
Boolean answer = AccessController.doPrivileged( Boolean answer = AccessController.doPrivileged(
new PrivilegedAction<Boolean>() { new PrivilegedAction<Boolean>() {
public Boolean run() { public Boolean run() {

View File

@ -72,19 +72,19 @@ final class LDAPCertStoreImpl {
private static final String ARL = "authorityRevocationList;binary"; private static final String ARL = "authorityRevocationList;binary";
// Constants for various empty values // Constants for various empty values
private final static String[] STRING0 = new String[0]; private static final String[] STRING0 = new String[0];
private final static byte[][] BB0 = new byte[0][]; private static final byte[][] BB0 = new byte[0][];
private final static Attributes EMPTY_ATTRIBUTES = new BasicAttributes(); private static final Attributes EMPTY_ATTRIBUTES = new BasicAttributes();
// cache related constants // cache related constants
private final static int DEFAULT_CACHE_SIZE = 750; private static final int DEFAULT_CACHE_SIZE = 750;
private final static int DEFAULT_CACHE_LIFETIME = 30; private static final int DEFAULT_CACHE_LIFETIME = 30;
private final static int LIFETIME; private static final int LIFETIME;
private final static String PROP_LIFETIME = private static final String PROP_LIFETIME =
"sun.security.certpath.ldap.cache.lifetime"; "sun.security.certpath.ldap.cache.lifetime";
/* /*
@ -92,7 +92,7 @@ final class LDAPCertStoreImpl {
* JNDI application resource files lookup to prevent recursion issues * JNDI application resource files lookup to prevent recursion issues
* when validating signed JARs with LDAP URLs in certificates. * when validating signed JARs with LDAP URLs in certificates.
*/ */
private final static String PROP_DISABLE_APP_RESOURCE_FILES = private static final String PROP_DISABLE_APP_RESOURCE_FILES =
"sun.security.certpath.ldap.disable.app.resource.files"; "sun.security.certpath.ldap.disable.app.resource.files";
static { static {