Moved locking to the superclass to simplify subclasses.

This commit is contained in:
akwizgran
2011-10-06 09:34:15 +01:00
parent ffe10e1502
commit 11b571fd8f
2 changed files with 25 additions and 23 deletions

View File

@@ -36,20 +36,12 @@ public class SimpleSocketPlugin extends SocketPlugin {
@Override
protected SocketAddress getLocalSocketAddress() {
Map<String, String> properties;
synchronized(this) {
properties = localProperties;
}
if(properties == null) return null;
return createSocketAddress(properties);
return createSocketAddress(localProperties);
}
@Override
protected SocketAddress getSocketAddress(ContactId c) {
Map<String, String> properties;
synchronized(this) {
properties = remoteProperties.get(c);
}
Map<String, String> properties = remoteProperties.get(c);
if(properties == null) return null;
return createSocketAddress(properties);
}