Use immutable collections for thread safety.

This commit is contained in:
akwizgran
2011-11-29 11:01:09 +00:00
parent 42430272f4
commit 7bf2ee64a8
15 changed files with 62 additions and 46 deletions

View File

@@ -241,7 +241,8 @@ class BluetoothPlugin extends AbstractPlugin implements StreamPlugin {
}
}
ContactListener listener = new ContactListener(discoveryAgent,
addresses, uuids);
Collections.unmodifiableMap(addresses),
Collections.unmodifiableMap(uuids));
synchronized(discoveryLock) {
try {
discoveryAgent.startInquiry(DiscoveryAgent.GIAC, listener);