private static final Logger log = Logger.getLogger(DaemonThreadFactory.class);
private static volatile int count;
-
- private static ThreadFactory instance;
+ private static volatile ThreadFactory instance;
private DaemonThreadFactory() {
- }
+ } // forbidden
/**
* Returns an instance of DaemonThreadFactory (as ThreadFactory).
}
try {
conn.close();
- log.debug("disconnected %s (conn=%08x, env=%08x)", connector.getId(), conn.hashCode(), hashCode());
+ if (log.isDebugEnabled()) {
+ final String id = (connector == null) ? "null" : connector.getId();
+ log.debug("disconnected %s (conn=%08x, env=%08x)", id, conn.hashCode(), hashCode());
+ }
if (Bootstrap.getPropertyAsBoolean("net.argius.stew.print-disconnected-time")) {
outputMessage("i.now", System.currentTimeMillis());
}
private final JCheckBox cUsesAutoRollback;
private List<ChangeListener> listenerList;
- private File currentDirectory;
+
+ private volatile File currentDirectory;
ConnectorEditDialog(JDialog owner, Connector connector) {
// [Init Instances]
String table) throws SQLException {
ResultSet rs = dbmeta.getPrimaryKeys(catalog, schema, table);
try {
- Map<Short, String> result = new TreeMap<Short, String>();
+ List<String> pkList = new ArrayList<String>();
Set<String> schemaSet = new HashSet<String>();
while (rs.next()) {
- result.put(rs.getShort(5), rs.getString(4));
+ pkList.add(rs.getString(4));
schemaSet.add(rs.getString(2));
}
- if (result.isEmpty() || schemaSet.size() != 1) {
+ if (schemaSet.size() != 1) {
return Collections.emptyList();
}
- List<String> pkList = new ArrayList<String>();
- for (Short key : result.keySet()) {
- pkList.add(result.get(key));
- }
return pkList;
} finally {
rs.close();