diff --git a/briar-core/src/org/briarproject/plugins/ConnectionRegistryImpl.java b/briar-core/src/org/briarproject/plugins/ConnectionRegistryImpl.java index 86cfab5a18b5fdc7d3908af341c274cdbc6d453f..6f01f02d7a597e49a94bb2932d47515eedc9d13d 100644 --- a/briar-core/src/org/briarproject/plugins/ConnectionRegistryImpl.java +++ b/briar-core/src/org/briarproject/plugins/ConnectionRegistryImpl.java @@ -41,7 +41,7 @@ class ConnectionRegistryImpl implements ConnectionRegistry { } public void registerConnection(ContactId c, TransportId t) { - LOG.info("Connection registered"); + if (LOG.isLoggable(INFO)) LOG.info("Connection registered: " + t); boolean firstConnection = false; lock.lock(); try { @@ -63,7 +63,6 @@ class ConnectionRegistryImpl implements ConnectionRegistry { } finally { lock.unlock(); } - if (firstConnection) { LOG.info("Contact connected"); eventBus.broadcast(new ContactConnectedEvent(c)); @@ -71,7 +70,7 @@ class ConnectionRegistryImpl implements ConnectionRegistry { } public void unregisterConnection(ContactId c, TransportId t) { - LOG.info("Connection unregistered"); + if (LOG.isLoggable(INFO)) LOG.info("Connection unregistered: " + t); boolean lastConnection = false; lock.lock(); try { @@ -95,15 +94,13 @@ class ConnectionRegistryImpl implements ConnectionRegistry { } finally { lock.unlock(); } - if (lastConnection) { LOG.info("Contact disconnected"); eventBus.broadcast(new ContactDisconnectedEvent(c)); } } - public Collection<ContactId> getConnectedContacts( - TransportId t) { + public Collection<ContactId> getConnectedContacts(TransportId t) { lock.lock(); try { Map<ContactId, Integer> m = connections.get(t); @@ -115,7 +112,6 @@ class ConnectionRegistryImpl implements ConnectionRegistry { } finally { lock.unlock(); } - } public boolean isConnected(ContactId c) { @@ -125,6 +121,5 @@ class ConnectionRegistryImpl implements ConnectionRegistry { } finally { lock.unlock(); } - } }