mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Remove unnecessary unmodifiable collection wrappers.
This commit is contained in:
@@ -42,6 +42,7 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
|
||||
contactCounts = new HashMap<ContactId, Integer>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerConnection(ContactId c, TransportId t,
|
||||
boolean incoming) {
|
||||
if (LOG.isLoggable(INFO)) {
|
||||
@@ -76,6 +77,7 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unregisterConnection(ContactId c, TransportId t,
|
||||
boolean incoming) {
|
||||
if (LOG.isLoggable(INFO)) {
|
||||
@@ -112,6 +114,7 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ContactId> getConnectedContacts(TransportId t) {
|
||||
lock.lock();
|
||||
try {
|
||||
@@ -120,12 +123,13 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
|
||||
List<ContactId> ids = new ArrayList<ContactId>(m.keySet());
|
||||
if (LOG.isLoggable(INFO))
|
||||
LOG.info(ids.size() + " contacts connected");
|
||||
return Collections.unmodifiableList(ids);
|
||||
return ids;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected(ContactId c, TransportId t) {
|
||||
lock.lock();
|
||||
try {
|
||||
@@ -136,6 +140,7 @@ class ConnectionRegistryImpl implements ConnectionRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isConnected(ContactId c) {
|
||||
lock.lock();
|
||||
try {
|
||||
|
||||
@@ -156,12 +156,12 @@ class PluginManagerImpl implements PluginManager, Service {
|
||||
|
||||
@Override
|
||||
public Collection<SimplexPlugin> getSimplexPlugins() {
|
||||
return Collections.unmodifiableList(simplexPlugins);
|
||||
return new ArrayList<SimplexPlugin>(simplexPlugins);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<DuplexPlugin> getDuplexPlugins() {
|
||||
return Collections.unmodifiableList(duplexPlugins);
|
||||
return new ArrayList<DuplexPlugin>(duplexPlugins);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -169,7 +169,7 @@ class PluginManagerImpl implements PluginManager, Service {
|
||||
List<DuplexPlugin> supported = new ArrayList<DuplexPlugin>();
|
||||
for (DuplexPlugin d : duplexPlugins)
|
||||
if (d.supportsInvitations()) supported.add(d);
|
||||
return Collections.unmodifiableList(supported);
|
||||
return supported;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -177,7 +177,7 @@ class PluginManagerImpl implements PluginManager, Service {
|
||||
List<DuplexPlugin> supported = new ArrayList<DuplexPlugin>();
|
||||
for (DuplexPlugin d : duplexPlugins)
|
||||
if (d.supportsKeyAgreement()) supported.add(d);
|
||||
return Collections.unmodifiableList(supported);
|
||||
return supported;
|
||||
}
|
||||
|
||||
private class PluginStarter implements Runnable {
|
||||
|
||||
Reference in New Issue
Block a user