diff --git a/briar-android/src/net/sf/briar/android/helloworld/HelloWorldService.java b/briar-android/src/net/sf/briar/android/helloworld/HelloWorldService.java index 7a046ad04adaa3715dd1edee98d368c3cc2b35e4..ed00b062594f9f4f5aad2d56b4b57ab937c233cb 100644 --- a/briar-android/src/net/sf/briar/android/helloworld/HelloWorldService.java +++ b/briar-android/src/net/sf/briar/android/helloworld/HelloWorldService.java @@ -72,9 +72,9 @@ public class HelloWorldService extends RoboService { if(LOG.isLoggable(INFO)) LOG.info(pluginsStarted + " plugins started"); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } @@ -89,9 +89,9 @@ public class HelloWorldService extends RoboService { db.close(); if(LOG.isLoggable(INFO)) LOG.info("Database closed"); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } diff --git a/briar-core/src/net/sf/briar/db/DatabaseCleanerImpl.java b/briar-core/src/net/sf/briar/db/DatabaseCleanerImpl.java index 4b22fcdecb6f73a98ba144c9781439ff1ff245b1..d515c1e1a3da291c30e9471a49f6ff0c3148d869 100644 --- a/briar-core/src/net/sf/briar/db/DatabaseCleanerImpl.java +++ b/briar-core/src/net/sf/briar/db/DatabaseCleanerImpl.java @@ -44,10 +44,10 @@ class DatabaseCleanerImpl extends TimerTask implements DatabaseCleaner { } catch(DbClosedException e) { if(LOG.isLoggable(INFO)) LOG.info("Database closed, exiting"); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); throw new Error(e); // Kill the application } catch(RuntimeException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); throw new Error(e); // Kill the application } } diff --git a/briar-core/src/net/sf/briar/db/DatabaseComponentImpl.java b/briar-core/src/net/sf/briar/db/DatabaseComponentImpl.java index 84d63e81fd128a5c20a65ef137a0e5b130e144db..8c81c4ee9f0a81ddb97aedbd5879b89881eccb0b 100644 --- a/briar-core/src/net/sf/briar/db/DatabaseComponentImpl.java +++ b/briar-core/src/net/sf/briar/db/DatabaseComponentImpl.java @@ -140,9 +140,11 @@ DatabaseCleaner.Callback { close(); } } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) + LOG.log(WARNING, e.toString(), e); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) + LOG.log(WARNING, e.toString(), e); } } }); diff --git a/briar-core/src/net/sf/briar/db/JdbcDatabase.java b/briar-core/src/net/sf/briar/db/JdbcDatabase.java index c254c0c7988115dc13d9ae20f7e7182ff94cfbdf..49a336cabb67b15644e09cd5562b2e2102ea05ca 100644 --- a/briar-core/src/net/sf/briar/db/JdbcDatabase.java +++ b/briar-core/src/net/sf/briar/db/JdbcDatabase.java @@ -362,7 +362,7 @@ abstract class JdbcDatabase implements Database<Connection> { if(s != null) try { s.close(); } catch(SQLException e) { - if(LOG.isLoggable(WARNING))LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING))LOG.log(WARNING, e.toString(), e); } } @@ -370,7 +370,7 @@ abstract class JdbcDatabase implements Database<Connection> { if(rs != null) try { rs.close(); } catch(SQLException e) { - if(LOG.isLoggable(WARNING))LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING))LOG.log(WARNING, e.toString(), e); } } @@ -406,11 +406,11 @@ abstract class JdbcDatabase implements Database<Connection> { } } catch(SQLException e) { // Try to close the connection - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); try { txn.close(); } catch(SQLException e1) { - if(LOG.isLoggable(WARNING)) LOG.warning(e1.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e1.toString(), e1); } // Whatever happens, allow the database to close synchronized(connections) { diff --git a/briar-core/src/net/sf/briar/invitation/AliceConnector.java b/briar-core/src/net/sf/briar/invitation/AliceConnector.java index a45d8b738c55524ed94291d5195e98f0e1f8637f..c54ab2d3b670c91094891a71adbfe0ecdfd67e50 100644 --- a/briar-core/src/net/sf/briar/invitation/AliceConnector.java +++ b/briar-core/src/net/sf/briar/invitation/AliceConnector.java @@ -66,11 +66,11 @@ class AliceConnector extends Connector { byte[] key = receivePublicKey(r); secret = deriveSharedSecret(hash, key, true); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); tryToClose(conn, true); return; } catch(GeneralSecurityException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); tryToClose(conn, true); return; } @@ -84,7 +84,7 @@ class AliceConnector extends Connector { if(receiveConfirmation(r)) group.remoteConfirmationSucceeded(); else group.remoteConfirmationFailed(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); tryToClose(conn, true); group.remoteConfirmationFailed(); return; diff --git a/briar-core/src/net/sf/briar/invitation/BobConnector.java b/briar-core/src/net/sf/briar/invitation/BobConnector.java index ea440d026b1245a76668d327065add1ddeb3c216..fefe8335a4a8500d9351468b4477667b7681d355 100644 --- a/briar-core/src/net/sf/briar/invitation/BobConnector.java +++ b/briar-core/src/net/sf/briar/invitation/BobConnector.java @@ -66,11 +66,11 @@ class BobConnector extends Connector { sendPublicKey(w); secret = deriveSharedSecret(hash, key, false); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); tryToClose(conn, true); return; } catch(GeneralSecurityException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); tryToClose(conn, true); return; } @@ -84,7 +84,7 @@ class BobConnector extends Connector { if(receiveConfirmation(r)) group.remoteConfirmationSucceeded(); else group.remoteConfirmationFailed(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); tryToClose(conn, true); group.remoteConfirmationFailed(); return; diff --git a/briar-core/src/net/sf/briar/invitation/Connector.java b/briar-core/src/net/sf/briar/invitation/Connector.java index e1adf6b2f6e7cf624ad16b1d79a457a0e6c1c691..501af0eddfe8c2c20f4d1375f36ad676775c3477 100644 --- a/briar-core/src/net/sf/briar/invitation/Connector.java +++ b/briar-core/src/net/sf/briar/invitation/Connector.java @@ -89,7 +89,7 @@ abstract class Connector extends Thread { try { conn.dispose(exception, true); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } diff --git a/briar-core/src/net/sf/briar/lifecycle/WindowsShutdownManagerImpl.java b/briar-core/src/net/sf/briar/lifecycle/WindowsShutdownManagerImpl.java index 7c011e13aed42b79366509a87add967659198cfe..b731ddc29a1fd114e108ef1c6bb81288af26eba6 100644 --- a/briar-core/src/net/sf/briar/lifecycle/WindowsShutdownManagerImpl.java +++ b/briar-core/src/net/sf/briar/lifecycle/WindowsShutdownManagerImpl.java @@ -134,7 +134,7 @@ class WindowsShutdownManagerImpl extends ShutdownManagerImpl { user32.DispatchMessage(msg); } } catch(UnsatisfiedLinkError e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } diff --git a/briar-core/src/net/sf/briar/plugins/PluginManagerImpl.java b/briar-core/src/net/sf/briar/plugins/PluginManagerImpl.java index 66fa356993d072d19559133abd386d382dd2a2c6..a785156fbca3fee5a9e91272ec79644b36059fb0 100644 --- a/briar-core/src/net/sf/briar/plugins/PluginManagerImpl.java +++ b/briar-core/src/net/sf/briar/plugins/PluginManagerImpl.java @@ -127,10 +127,10 @@ class PluginManagerImpl implements PluginManager { + " did not start"); } } catch(ClassCastException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); continue; } catch(Exception e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); continue; } } @@ -165,10 +165,10 @@ class PluginManagerImpl implements PluginManager { + " did not start"); } } catch(ClassCastException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); continue; } catch(Exception e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); continue; } } @@ -204,7 +204,7 @@ class PluginManagerImpl implements PluginManager { plugin.stop(); stopped++; } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } simplexPlugins.clear(); @@ -215,7 +215,7 @@ class PluginManagerImpl implements PluginManager { plugin.stop(); stopped++; } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } duplexPlugins.clear(); @@ -246,7 +246,7 @@ class PluginManagerImpl implements PluginManager { try { return db.getConfig(id); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return new TransportConfig(); } } @@ -256,7 +256,7 @@ class PluginManagerImpl implements PluginManager { TransportProperties p = db.getLocalProperties(id); return p == null ? new TransportProperties() : p; } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return new TransportProperties(); } } @@ -265,7 +265,7 @@ class PluginManagerImpl implements PluginManager { try { return db.getRemoteProperties(id); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return Collections.emptyMap(); } } @@ -274,7 +274,7 @@ class PluginManagerImpl implements PluginManager { try { db.mergeConfig(id, c); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } @@ -282,7 +282,7 @@ class PluginManagerImpl implements PluginManager { try { db.mergeLocalProperties(id, p); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } diff --git a/briar-core/src/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java b/briar-core/src/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java index 7eb6ebb321379af70dfbfdd4edcd71d9e961548f..194f6c6eec9898169c32dff3502670a6c8c25bb0 100644 --- a/briar-core/src/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java +++ b/briar-core/src/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java @@ -109,7 +109,7 @@ class BluetoothPlugin implements DuplexPlugin { try { scn = (StreamConnectionNotifier) Connector.open(url); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return; } if(!running) { @@ -133,7 +133,7 @@ class BluetoothPlugin implements DuplexPlugin { try { scn.close(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } @@ -144,7 +144,7 @@ class BluetoothPlugin implements DuplexPlugin { s = scn.acceptAndOpen(); } catch(IOException e) { // This is expected when the socket is closed - if(LOG.isLoggable(INFO)) LOG.info(e.toString()); + if(LOG.isLoggable(INFO)) LOG.log(INFO, e.toString(), e); tryToClose(scn); return; } @@ -198,7 +198,7 @@ class BluetoothPlugin implements DuplexPlugin { StreamConnection s = (StreamConnection) Connector.open(url); return new BluetoothTransportConnection(s); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return null; } } @@ -237,7 +237,7 @@ class BluetoothPlugin implements DuplexPlugin { url = listener.waitForUrl(); } catch(BluetoothStateException e) { if(LOG.isLoggable(WARNING)) - LOG.warning(e.toString()); + LOG.log(WARNING, e.toString(), e); return null; } catch(InterruptedException e) { if(LOG.isLoggable(INFO)) @@ -270,7 +270,7 @@ class BluetoothPlugin implements DuplexPlugin { try { scn = (StreamConnectionNotifier) Connector.open(url); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return null; } if(!running) { @@ -290,7 +290,7 @@ class BluetoothPlugin implements DuplexPlugin { return new BluetoothTransportConnection(s); } catch(IOException e) { // This is expected when the socket is closed - if(LOG.isLoggable(INFO)) LOG.info(e.toString()); + if(LOG.isLoggable(INFO)) LOG.log(INFO, e.toString(), e); return null; } finally { if(f.cancel(false)) tryToClose(scn); @@ -303,7 +303,7 @@ class BluetoothPlugin implements DuplexPlugin { try { localDevice.setDiscoverable(GIAC); } catch(BluetoothStateException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } diff --git a/briar-core/src/net/sf/briar/plugins/bluetooth/InvitationListener.java b/briar-core/src/net/sf/briar/plugins/bluetooth/InvitationListener.java index 5e13fe9f4a81b02da2eefd0713a62751c6c162d6..c903b93eed8f8c5ca1a7c2f2ad9781a2287efdb6 100644 --- a/briar-core/src/net/sf/briar/plugins/bluetooth/InvitationListener.java +++ b/briar-core/src/net/sf/briar/plugins/bluetooth/InvitationListener.java @@ -48,7 +48,7 @@ class InvitationListener implements DiscoveryListener { discoveryAgent.searchServices(null, uuids, device, this); searches.incrementAndGet(); } catch(BluetoothStateException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } diff --git a/briar-core/src/net/sf/briar/plugins/droidtooth/DroidtoothPlugin.java b/briar-core/src/net/sf/briar/plugins/droidtooth/DroidtoothPlugin.java index ef19fe4b1e2f058bd53fff3da53d44c1b9ff5393..cac515891d0c7627830959f28f2d91fa8e811c8a 100644 --- a/briar-core/src/net/sf/briar/plugins/droidtooth/DroidtoothPlugin.java +++ b/briar-core/src/net/sf/briar/plugins/droidtooth/DroidtoothPlugin.java @@ -128,7 +128,7 @@ class DroidtoothPlugin implements DuplexPlugin { try { ss = InsecureBluetooth.listen(adapter, "RFCOMM", getUuid()); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return; } if(!running) { @@ -166,7 +166,7 @@ class DroidtoothPlugin implements DuplexPlugin { try { ss.close(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } @@ -177,7 +177,7 @@ class DroidtoothPlugin implements DuplexPlugin { s = ss.accept(); } catch(IOException e) { // This is expected when the socket is closed - if(LOG.isLoggable(INFO)) LOG.info(e.toString()); + if(LOG.isLoggable(INFO)) LOG.log(INFO, e.toString(), e); tryToClose(ss); return; } @@ -246,7 +246,7 @@ class DroidtoothPlugin implements DuplexPlugin { s.connect(); return new DroidtoothTransportConnection(s); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return null; } } @@ -298,7 +298,7 @@ class DroidtoothPlugin implements DuplexPlugin { try { ss = InsecureBluetooth.listen(adapter, "RFCOMM", uuid); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return null; } // Return the first connection received by the socket, if any @@ -308,7 +308,7 @@ class DroidtoothPlugin implements DuplexPlugin { if(LOG.isLoggable(INFO)) LOG.info("Invitation timed out"); return null; } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return null; } finally { tryToClose(ss); diff --git a/briar-core/src/net/sf/briar/plugins/file/FilePlugin.java b/briar-core/src/net/sf/briar/plugins/file/FilePlugin.java index cf9e5a9c4812b7e034338617839cd8ccde26c240..d00b3d353a079f5505038e0bbfa64c54048e098c 100644 --- a/briar-core/src/net/sf/briar/plugins/file/FilePlugin.java +++ b/briar-core/src/net/sf/briar/plugins/file/FilePlugin.java @@ -74,7 +74,7 @@ public abstract class FilePlugin implements SimplexPlugin { OutputStream out = new FileOutputStream(f); return new FileTransportWriter(f, out, capacity, this); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); f.delete(); return null; } @@ -104,7 +104,8 @@ public abstract class FilePlugin implements SimplexPlugin { callback.readerCreated(new FileTransportReader(file, in, FilePlugin.this)); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) + LOG.log(WARNING, e.toString(), e); } } } diff --git a/briar-core/src/net/sf/briar/plugins/file/FileTransportReader.java b/briar-core/src/net/sf/briar/plugins/file/FileTransportReader.java index 79be1009100061f73de16d86c0fff5710317b452..e2c7648c95fd897d688587322c3c43fd536b4388 100644 --- a/briar-core/src/net/sf/briar/plugins/file/FileTransportReader.java +++ b/briar-core/src/net/sf/briar/plugins/file/FileTransportReader.java @@ -32,7 +32,7 @@ class FileTransportReader implements SimplexTransportReader { try { in.close(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } if(recognised) { file.delete(); diff --git a/briar-core/src/net/sf/briar/plugins/file/FileTransportWriter.java b/briar-core/src/net/sf/briar/plugins/file/FileTransportWriter.java index d3795347a265a7cd03d871c785573269812cae63..c40e0ca33fe5566e61239754d3e8a4a7afd5609d 100644 --- a/briar-core/src/net/sf/briar/plugins/file/FileTransportWriter.java +++ b/briar-core/src/net/sf/briar/plugins/file/FileTransportWriter.java @@ -43,7 +43,7 @@ class FileTransportWriter implements SimplexTransportWriter { try { out.close(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } if(exception) file.delete(); else plugin.writerFinished(file); diff --git a/briar-core/src/net/sf/briar/plugins/file/RemovableDrivePlugin.java b/briar-core/src/net/sf/briar/plugins/file/RemovableDrivePlugin.java index 3657ee8518cd3fb94014ec9e1c77af7ee0064dfa..9e95cc865e01cbf078ab177449e14a8a22e7de26 100644 --- a/briar-core/src/net/sf/briar/plugins/file/RemovableDrivePlugin.java +++ b/briar-core/src/net/sf/briar/plugins/file/RemovableDrivePlugin.java @@ -85,7 +85,7 @@ implements RemovableDriveMonitor.Callback { if(i == -1) return null; return drives.get(i); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return null; } } @@ -114,7 +114,7 @@ implements RemovableDriveMonitor.Callback { } } } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } return Collections.unmodifiableList(matches); } @@ -127,6 +127,6 @@ implements RemovableDriveMonitor.Callback { } public void exceptionThrown(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } diff --git a/briar-core/src/net/sf/briar/plugins/tcp/LanTcpPlugin.java b/briar-core/src/net/sf/briar/plugins/tcp/LanTcpPlugin.java index 3a710ae6ca91da3ad231574d824f2d7751a4e6ad..6812c7236c4ca9dd902f43f037e22e75686a8b5a 100644 --- a/briar-core/src/net/sf/briar/plugins/tcp/LanTcpPlugin.java +++ b/briar-core/src/net/sf/briar/plugins/tcp/LanTcpPlugin.java @@ -70,16 +70,16 @@ class LanTcpPlugin extends TcpPlugin { addrs.add(new InetSocketAddress(addr, port)); addrs.add(new InetSocketAddress(addr, 0)); } catch(NumberFormatException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } catch(UnknownHostException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } List<NetworkInterface> ifaces; try { ifaces = Collections.list(NetworkInterface.getNetworkInterfaces()); } catch(SocketException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return addrs; } // Prefer interfaces with link-local or site-local addresses @@ -123,7 +123,7 @@ class LanTcpPlugin extends TcpPlugin { ms.setInterface(iface); ms.joinGroup(mcast.getAddress()); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); if(ms != null) tryToClose(ms, mcast.getAddress()); return null; } @@ -149,7 +149,7 @@ class LanTcpPlugin extends TcpPlugin { return new TcpTransportConnection(s); } catch(IOException e) { if(LOG.isLoggable(WARNING)) - LOG.warning(e.toString()); + LOG.log(WARNING, e.toString(), e); } } } catch(SocketTimeoutException e) { @@ -161,7 +161,7 @@ class LanTcpPlugin extends TcpPlugin { if(LOG.isLoggable(INFO)) LOG.info("Timeout while sending invitation"); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } finally { tryToClose(ms, mcast.getAddress()); } @@ -201,7 +201,7 @@ class LanTcpPlugin extends TcpPlugin { try { ms.leaveGroup(addr); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } ms.close(); } @@ -250,7 +250,7 @@ class LanTcpPlugin extends TcpPlugin { ss = new ServerSocket(); ss.bind(new InetSocketAddress(iface, 0)); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); if(ss != null) tryToClose(ss); return null; } @@ -262,7 +262,7 @@ class LanTcpPlugin extends TcpPlugin { ms = new MulticastSocket(); ms.setInterface(iface); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); if(ms != null) ms.close(); tryToClose(ss); return null; @@ -299,7 +299,7 @@ class LanTcpPlugin extends TcpPlugin { if(LOG.isLoggable(INFO)) LOG.info("Timeout while accepting invitation"); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } finally { ms.close(); tryToClose(ss); diff --git a/briar-core/src/net/sf/briar/plugins/tcp/PortMapperImpl.java b/briar-core/src/net/sf/briar/plugins/tcp/PortMapperImpl.java index bb7606e8aa58efc9fba4df0ad437cba0b6ca31b4..c5a24dc2e9668ff7f0248e3c8439d1386f3f60fd 100644 --- a/briar-core/src/net/sf/briar/plugins/tcp/PortMapperImpl.java +++ b/briar-core/src/net/sf/briar/plugins/tcp/PortMapperImpl.java @@ -53,9 +53,9 @@ class PortMapperImpl implements PortMapper { if(externalString != null) external = InetAddress.getByName(externalString); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } catch(SAXException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } return new MappingResult(internal, external, port, succeeded); } @@ -65,11 +65,11 @@ class PortMapperImpl implements PortMapper { try { d.discover(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } catch(SAXException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } catch(ParserConfigurationException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } gateway = d.getValidGateway(); } @@ -80,9 +80,9 @@ class PortMapperImpl implements PortMapper { if(LOG.isLoggable(INFO)) LOG.info("Deleted mapping for port " + port); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } catch(SAXException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } diff --git a/briar-core/src/net/sf/briar/plugins/tcp/TcpPlugin.java b/briar-core/src/net/sf/briar/plugins/tcp/TcpPlugin.java index 6993172d4838826b9813c774da6c0b6358df2b46..d9d4da9ab458a34e7cb366e3aab02f7a278b5159 100644 --- a/briar-core/src/net/sf/briar/plugins/tcp/TcpPlugin.java +++ b/briar-core/src/net/sf/briar/plugins/tcp/TcpPlugin.java @@ -63,7 +63,7 @@ abstract class TcpPlugin implements DuplexPlugin { try { ss = new ServerSocket(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return; } boolean found = false; @@ -73,7 +73,7 @@ abstract class TcpPlugin implements DuplexPlugin { found = true; break; } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); tryToClose(ss); continue; } @@ -100,7 +100,7 @@ abstract class TcpPlugin implements DuplexPlugin { try { ss.close(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } @@ -120,7 +120,7 @@ abstract class TcpPlugin implements DuplexPlugin { s.setSoTimeout(0); } catch(IOException e) { // This is expected when the socket is closed - if(LOG.isLoggable(INFO)) LOG.info(e.toString()); + if(LOG.isLoggable(INFO)) LOG.log(INFO, e.toString(), e); tryToClose(ss); return; } @@ -172,7 +172,7 @@ abstract class TcpPlugin implements DuplexPlugin { s.connect(addr); return new TcpTransportConnection(s); } catch(IOException e) { - if(LOG.isLoggable(INFO)) LOG.info(e.toString()); + if(LOG.isLoggable(INFO)) LOG.log(INFO, e.toString(), e); return null; } } @@ -188,9 +188,9 @@ abstract class TcpPlugin implements DuplexPlugin { int port = Integer.valueOf(portString); return new InetSocketAddress(addr, port); } catch(NumberFormatException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } catch(UnknownHostException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } return null; diff --git a/briar-core/src/net/sf/briar/plugins/tcp/WanTcpPlugin.java b/briar-core/src/net/sf/briar/plugins/tcp/WanTcpPlugin.java index 3b8a6a9c03496e4ebf8f900d115818c2d6b9e21b..a2c115ed56d9316a87743ae5e55a7a976c4be167 100644 --- a/briar-core/src/net/sf/briar/plugins/tcp/WanTcpPlugin.java +++ b/briar-core/src/net/sf/briar/plugins/tcp/WanTcpPlugin.java @@ -68,9 +68,9 @@ class WanTcpPlugin extends TcpPlugin { addrs.add(new InetSocketAddress(addr, port)); addrs.add(new InetSocketAddress(addr, 0)); } catch(NumberFormatException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } catch(UnknownHostException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } // Get a list of the device's network interfaces @@ -78,7 +78,7 @@ class WanTcpPlugin extends TcpPlugin { try { ifaces = Collections.list(NetworkInterface.getNetworkInterfaces()); } catch(SocketException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return addrs; } // Accept interfaces without link-local or site-local addresses diff --git a/briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java b/briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java index 8737686ad2f4df053fffe8006857a3ba26fe0700..a8368450e6230bdb72ef2dfb5715ace89a50f64d 100644 --- a/briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java +++ b/briar-core/src/net/sf/briar/plugins/tor/TorPlugin.java @@ -119,7 +119,7 @@ class TorPlugin implements DuplexPlugin { addr = util.parseTorHiddenServicePrivateNetAddressFromStrings( privateKey, "", false); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); addr = createHiddenServiceAddress(util); } } @@ -131,7 +131,7 @@ class TorPlugin implements DuplexPlugin { try { ss = nl.createNetServerSocket(null, addrPort); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return; } synchronized(this) { @@ -165,7 +165,7 @@ class TorPlugin implements DuplexPlugin { try { nl.clear(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } @@ -173,7 +173,7 @@ class TorPlugin implements DuplexPlugin { try { ss.close(); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } @@ -184,7 +184,7 @@ class TorPlugin implements DuplexPlugin { s = ss.accept(); } catch(IOException e) { // This is expected when the socket is closed - if(LOG.isLoggable(INFO)) LOG.info(e.toString()); + if(LOG.isLoggable(INFO)) LOG.log(INFO, e.toString(), e); tryToClose(ss); return; } @@ -272,7 +272,7 @@ class TorPlugin implements DuplexPlugin { if(LOG.isLoggable(INFO)) LOG.info("Connected to hidden service"); return new TorTransportConnection(s); } catch(IOException e) { - if(LOG.isLoggable(INFO)) LOG.info(e.toString()); + if(LOG.isLoggable(INFO)) LOG.log(INFO, e.toString(), e); return null; } } diff --git a/briar-core/src/net/sf/briar/protocol/duplex/DuplexConnection.java b/briar-core/src/net/sf/briar/protocol/duplex/DuplexConnection.java index b5b669d2a9052e6915de96ba2ed01b90d0a4576f..4eb35d8b70951eeac55b7f0c371ee5970da67bce 100644 --- a/briar-core/src/net/sf/briar/protocol/duplex/DuplexConnection.java +++ b/briar-core/src/net/sf/briar/protocol/duplex/DuplexConnection.java @@ -181,7 +181,7 @@ abstract class DuplexConnection implements DatabaseListener { // The writer will dispose of the transport if no exceptions occur writerTasks.add(CLOSE); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, true); } } @@ -223,7 +223,7 @@ abstract class DuplexConnection implements DatabaseListener { LOG.info("Interrupted while waiting for task"); dispose(true, true); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, true); } finally { connRegistry.unregisterConnection(contactId, transportId); @@ -237,7 +237,7 @@ abstract class DuplexConnection implements DatabaseListener { try { transport.dispose(exception, recognised); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } @@ -254,7 +254,7 @@ abstract class DuplexConnection implements DatabaseListener { try { db.receiveAck(contactId, ack); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -273,7 +273,7 @@ abstract class DuplexConnection implements DatabaseListener { Batch b = batch.verify(); dbExecutor.execute(new ReceiveBatch(b)); } catch(GeneralSecurityException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -291,7 +291,7 @@ abstract class DuplexConnection implements DatabaseListener { try { db.receiveBatch(contactId, batch); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -310,7 +310,7 @@ abstract class DuplexConnection implements DatabaseListener { Request r = db.receiveOffer(contactId, offer); writerTasks.add(new WriteRequest(r)); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -329,7 +329,7 @@ abstract class DuplexConnection implements DatabaseListener { try { writer.writeRequest(request); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, true); } } @@ -348,7 +348,7 @@ abstract class DuplexConnection implements DatabaseListener { try { db.setSeen(contactId, seen); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -366,7 +366,7 @@ abstract class DuplexConnection implements DatabaseListener { try { db.receiveSubscriptionUpdate(contactId, update); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -384,7 +384,7 @@ abstract class DuplexConnection implements DatabaseListener { try { db.receiveTransportUpdate(contactId, update); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -399,7 +399,7 @@ abstract class DuplexConnection implements DatabaseListener { Ack a = db.generateAck(contactId, maxBatches); if(a != null) writerTasks.add(new WriteAck(a)); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -419,7 +419,7 @@ abstract class DuplexConnection implements DatabaseListener { writer.writeAck(ack); dbExecutor.execute(new GenerateAcks()); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, true); } } @@ -442,7 +442,7 @@ abstract class DuplexConnection implements DatabaseListener { if(b == null) new GenerateOffer().run(); else writerTasks.add(new WriteBatch(b, requested)); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -465,7 +465,7 @@ abstract class DuplexConnection implements DatabaseListener { if(requested.isEmpty()) dbExecutor.execute(new GenerateOffer()); else dbExecutor.execute(new GenerateBatches(requested)); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, true); } } @@ -489,7 +489,7 @@ abstract class DuplexConnection implements DatabaseListener { writerTasks.add(new WriteOffer(o)); } } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -508,7 +508,7 @@ abstract class DuplexConnection implements DatabaseListener { try { writer.writeOffer(offer); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, true); } } @@ -522,7 +522,7 @@ abstract class DuplexConnection implements DatabaseListener { SubscriptionUpdate s = db.generateSubscriptionUpdate(contactId); if(s != null) writerTasks.add(new WriteSubscriptionUpdate(s)); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -541,7 +541,7 @@ abstract class DuplexConnection implements DatabaseListener { try { writer.writeSubscriptionUpdate(update); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, true); } } @@ -555,7 +555,7 @@ abstract class DuplexConnection implements DatabaseListener { TransportUpdate t = db.generateTransportUpdate(contactId); if(t != null) writerTasks.add(new WriteTransportUpdate(t)); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -574,7 +574,7 @@ abstract class DuplexConnection implements DatabaseListener { try { writer.writeTransportUpdate(update); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, true); } } diff --git a/briar-core/src/net/sf/briar/protocol/simplex/IncomingSimplexConnection.java b/briar-core/src/net/sf/briar/protocol/simplex/IncomingSimplexConnection.java index 4096b4237e03202fa2d4963caf9e195391887b13..24ae0701b8231c31ea720d9dbf2badf20376039d 100644 --- a/briar-core/src/net/sf/briar/protocol/simplex/IncomingSimplexConnection.java +++ b/briar-core/src/net/sf/briar/protocol/simplex/IncomingSimplexConnection.java @@ -89,7 +89,7 @@ class IncomingSimplexConnection { } dispose(false, true); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, true); } finally { connRegistry.unregisterConnection(contactId, transportId); @@ -101,7 +101,7 @@ class IncomingSimplexConnection { try { transport.dispose(exception, recognised); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } @@ -117,7 +117,7 @@ class IncomingSimplexConnection { try { db.receiveAck(contactId, ack); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -135,7 +135,7 @@ class IncomingSimplexConnection { Batch b = batch.verify(); dbExecutor.execute(new ReceiveBatch(b)); } catch(GeneralSecurityException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -152,7 +152,7 @@ class IncomingSimplexConnection { try { db.receiveBatch(contactId, batch); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -169,7 +169,7 @@ class IncomingSimplexConnection { try { db.receiveSubscriptionUpdate(contactId, update); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } @@ -186,7 +186,7 @@ class IncomingSimplexConnection { try { db.receiveTransportUpdate(contactId, update); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } diff --git a/briar-core/src/net/sf/briar/protocol/simplex/OutgoingSimplexConnection.java b/briar-core/src/net/sf/briar/protocol/simplex/OutgoingSimplexConnection.java index db5752abe0d616fc5889232fe303f52edebfdd89..eea83eeddf4ccaa69be858d348910e5bbbd43454 100644 --- a/briar-core/src/net/sf/briar/protocol/simplex/OutgoingSimplexConnection.java +++ b/briar-core/src/net/sf/briar/protocol/simplex/OutgoingSimplexConnection.java @@ -99,10 +99,10 @@ class OutgoingSimplexConnection { writer.close(); dispose(false); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true); } finally { connRegistry.unregisterConnection(contactId, transportId); @@ -114,7 +114,7 @@ class OutgoingSimplexConnection { try { transport.dispose(exception); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } diff --git a/briar-core/src/net/sf/briar/transport/ConnectionDispatcherImpl.java b/briar-core/src/net/sf/briar/transport/ConnectionDispatcherImpl.java index 4ccbc97b89edd8294355e0b08c1645f86863cea4..220e36d8f89f61d60b0858902d1dfdb4328898b0 100644 --- a/briar-core/src/net/sf/briar/transport/ConnectionDispatcherImpl.java +++ b/briar-core/src/net/sf/briar/transport/ConnectionDispatcherImpl.java @@ -98,18 +98,20 @@ class ConnectionDispatcherImpl implements ConnectionDispatcher { transport); } } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); try { transport.dispose(true, false); } catch(IOException e1) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) + LOG.log(WARNING, e1.toString(), e1); } } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); try { transport.dispose(true, false); } catch(IOException e1) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) + LOG.log(WARNING, e1.toString(), e1); } } } @@ -131,7 +133,7 @@ class ConnectionDispatcherImpl implements ConnectionDispatcher { try { tag = readTag(transport.getInputStream()); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, false); return; } @@ -139,7 +141,7 @@ class ConnectionDispatcherImpl implements ConnectionDispatcher { try { ctx = recogniser.acceptConnection(transportId, tag); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); dispose(true, false); return; } @@ -151,7 +153,7 @@ class ConnectionDispatcherImpl implements ConnectionDispatcher { try { transport.dispose(exception, recognised); } catch(IOException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } } } diff --git a/briar-core/src/net/sf/briar/transport/KeyManagerImpl.java b/briar-core/src/net/sf/briar/transport/KeyManagerImpl.java index 39b4175abc681e950e75cb247b58c03d32d55f02..5117562d4c9b1b92ff4b94265bcce6294ca819c3 100644 --- a/briar-core/src/net/sf/briar/transport/KeyManagerImpl.java +++ b/briar-core/src/net/sf/briar/transport/KeyManagerImpl.java @@ -64,7 +64,7 @@ class KeyManagerImpl extends TimerTask implements KeyManager, DatabaseListener { try { secrets = db.getSecrets(); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return false; } // Work out what phase of its lifecycle each secret is in @@ -77,7 +77,7 @@ class KeyManagerImpl extends TimerTask implements KeyManager, DatabaseListener { try { db.addSecrets(created); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return false; } } @@ -224,7 +224,7 @@ class KeyManagerImpl extends TimerTask implements KeyManager, DatabaseListener { try { connection = db.incrementConnectionCounter(c, t, s.getPeriod()); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); return null; } byte[] secret = s.getSecret().clone(); @@ -269,7 +269,7 @@ class KeyManagerImpl extends TimerTask implements KeyManager, DatabaseListener { try { db.addSecrets(Arrays.asList(s1, s2)); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } // Pass the new secrets to the recogniser recogniser.addSecret(s1); @@ -304,7 +304,7 @@ class KeyManagerImpl extends TimerTask implements KeyManager, DatabaseListener { try { db.addSecrets(created); } catch(DbException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); } // Pass any secrets that have been created to the recogniser for(TemporarySecret s : created) recogniser.addSecret(s); diff --git a/briar-core/src/net/sf/briar/util/BoundedExecutor.java b/briar-core/src/net/sf/briar/util/BoundedExecutor.java index 89cb7efc6a0596eeab7acd4030a6407e3df9542d..c7d77a8af253aec96a4c56cac6442785834b1b5d 100644 --- a/briar-core/src/net/sf/briar/util/BoundedExecutor.java +++ b/briar-core/src/net/sf/briar/util/BoundedExecutor.java @@ -50,7 +50,7 @@ public class BoundedExecutor implements Executor { Thread.currentThread().interrupt(); throw new RejectedExecutionException(); } catch(RejectedExecutionException e) { - if(LOG.isLoggable(WARNING)) LOG.warning(e.toString()); + if(LOG.isLoggable(WARNING)) LOG.log(WARNING, e.toString(), e); semaphore.release(); throw e; }