Introduce some finality.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2726 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2010-02-09 21:16:12 +00:00
parent 9cf8d22e1d
commit 28a48351fa
4 changed files with 19 additions and 18 deletions
+1 -1
View File
@@ -28,5 +28,5 @@ import com.samskivert.util.Logger;
public class Log public class Log
{ {
/** We dispatch our log messages through this logger. */ /** We dispatch our log messages through this logger. */
public static Logger log = Logger.getLogger("com.samskivert"); public static final Logger log = Logger.getLogger("com.samskivert");
} }
+1 -1
View File
@@ -649,5 +649,5 @@ public class JDBCUtil
} }
/** Used by {@link #makeCollectingConnection}. */ /** Used by {@link #makeCollectingConnection}. */
protected static Class<?>[] PROXY_IFACES = { Connection.class }; protected static final Class<?>[] PROXY_IFACES = { Connection.class };
} }
+14 -13
View File
@@ -429,7 +429,7 @@ public class Table<T>
* components "x" and "y", then database table should have columns * components "x" and "y", then database table should have columns
* "location_x" and "location_y" (if '_' is used as separator). * "location_x" and "location_y" (if '_' is used as separator).
*/ */
public static String fieldSeparator = "_"; public static final String fieldSeparator = "_";
protected final void init (Class<T> clazz, String tableName, String[] keys, protected final void init (Class<T> clazz, String tableName, String[] keys,
boolean mixedCaseConvert) boolean mixedCaseConvert)
@@ -877,6 +877,17 @@ public class Table<T>
return column; return column;
} }
protected static Method getSetBypass ()
{
try {
Class<?> c = Class.forName("java.lang.reflect.AccessibleObject");
return c.getMethod("setAccessible", new Class<?>[] { Boolean.TYPE });
} catch (Exception ex) {
System.err.println("Unable to reflect AccessibleObject.setAccessible: " + ex);
return null;
}
}
protected String name; protected String name;
protected String listOfFields; protected String listOfFields;
protected String qualifiedListOfFields; protected String qualifiedListOfFields;
@@ -895,22 +906,12 @@ public class Table<T>
protected int primaryKeyIndices[]; protected int primaryKeyIndices[];
protected Constructor<T> constructor; protected Constructor<T> constructor;
protected static Method setBypass;
protected static Class<Serializable> serializableClass; protected static final Method setBypass = getSetBypass();
protected static final Class<Serializable> serializableClass = Serializable.class;
protected static final Object[] bypassFlag = { Boolean.TRUE }; protected static final Object[] bypassFlag = { Boolean.TRUE };
protected static final Object[] constructorArgs = {}; protected static final Object[] constructorArgs = {};
// used to identify byte[] fields // used to identify byte[] fields
protected static final byte[] BYTE_PROTO = new byte[0]; protected static final byte[] BYTE_PROTO = new byte[0];
static {
try {
serializableClass = Serializable.class;
Class<?> c = Class.forName("java.lang.reflect.AccessibleObject");
setBypass = c.getMethod("setAccessible", new Class<?>[] { Boolean.TYPE });
} catch (Exception ex) {
System.err.println("Unable to reflect AccessibleObject.setAccessible: " + ex);
}
}
} }
+3 -3
View File
@@ -161,11 +161,11 @@ public class MACUtil
/** Look for 2 hex values in a row followed by a ':' or '-' repeated 5 times, followed by 2 hex /** Look for 2 hex values in a row followed by a ':' or '-' repeated 5 times, followed by 2 hex
* values. */ * values. */
protected static Pattern MACRegex = protected static final Pattern MACRegex =
Pattern.compile("((?:\\p{XDigit}{2}+[:\\-]){5}+\\p{XDigit}{2}+)", Pattern.CASE_INSENSITIVE); Pattern.compile("((?:\\p{XDigit}{2}+[:\\-]){5}+\\p{XDigit}{2}+)", Pattern.CASE_INSENSITIVE);
// TODO maybe we should obfuscate these with rot13 or something so // TODO maybe we should obfuscate these with rot13 or something so
// that people can't run 'strings' on us and instantly see what we try // that people can't run 'strings' on us and instantly see what we try
protected static String[] WINDOWS_CMDS = {"ipconfig /all"}; protected static final String[] WINDOWS_CMDS = {"ipconfig /all"};
protected static String[] UNIX_CMDS = {"/sbin/ifconfig", "/etc/ifconfig"}; protected static final String[] UNIX_CMDS = {"/sbin/ifconfig", "/etc/ifconfig"};
} }