From 0728f7693390d82b39055bc6e07bac6013dd18f0 Mon Sep 17 00:00:00 2001
From: akwizgran <akwizgran@users.sourceforge.net>
Date: Fri, 28 Oct 2011 12:54:20 +0100
Subject: [PATCH] Ignore case when comparing Bluetooth UUIDs.

---
 .../net/sf/briar/plugins/bluetooth/BluetoothPlugin.java      | 2 --
 .../net/sf/briar/plugins/bluetooth/ContactListener.java      | 5 +----
 .../net/sf/briar/plugins/bluetooth/InvitationListener.java   | 2 +-
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/components/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java b/components/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java
index bdcd3113b6..8a2cf684c0 100644
--- a/components/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java
+++ b/components/net/sf/briar/plugins/bluetooth/BluetoothPlugin.java
@@ -233,8 +233,6 @@ class BluetoothPlugin extends AbstractPlugin implements StreamPlugin {
 			String address = p.get("address");
 			String uuid = p.get("uuid");
 			if(address != null && uuid != null) {
-				if(LOG.isLoggable(Level.FINE))
-					LOG.fine("Searching for " + uuid + " at " + address);
 				addresses.put(address, c);
 				uuids.put(c, uuid);
 			}
diff --git a/components/net/sf/briar/plugins/bluetooth/ContactListener.java b/components/net/sf/briar/plugins/bluetooth/ContactListener.java
index 544cb338f0..21b3cfc36d 100644
--- a/components/net/sf/briar/plugins/bluetooth/ContactListener.java
+++ b/components/net/sf/briar/plugins/bluetooth/ContactListener.java
@@ -81,8 +81,7 @@ class ContactListener implements DiscoveryListener {
 		for(ServiceRecord record : services) {
 			// Do we recognise the address?
 			RemoteDevice device = record.getHostDevice();
-			String address = device.getBluetoothAddress();
-			ContactId c = addresses.get(address);
+			ContactId c = addresses.get(device.getBluetoothAddress());
 			if(c == null) continue;
 			// Do we have a UUID for this contact?
 			String uuid = uuids.get(c);
@@ -101,8 +100,6 @@ class ContactListener implements DiscoveryListener {
 				UUID serviceUuid = (UUID) classId.getValue();
 				if(uuid.equalsIgnoreCase(serviceUuid.toString())) {
 					// The UUID matches - store the URL
-					if(LOG.isLoggable(Level.FINE))
-						LOG.fine("Discovered " + uuid + " at " + address);
 					urls.put(c, serviceUrl);
 				}
 			}
diff --git a/components/net/sf/briar/plugins/bluetooth/InvitationListener.java b/components/net/sf/briar/plugins/bluetooth/InvitationListener.java
index 96a94fc209..46265bdb2f 100644
--- a/components/net/sf/briar/plugins/bluetooth/InvitationListener.java
+++ b/components/net/sf/briar/plugins/bluetooth/InvitationListener.java
@@ -77,7 +77,7 @@ class InvitationListener implements DiscoveryListener {
 				(Enumeration<DataElement>) classIds.getValue();
 			for(DataElement classId : Collections.list(e)) {
 				UUID serviceUuid = (UUID) classId.getValue();
-				if(uuid.equals(serviceUuid.toString())) {
+				if(uuid.equalsIgnoreCase(serviceUuid.toString())) {
 					// The UUID matches - store the URL
 					synchronized(this) {
 						url = serviceUrl;
-- 
GitLab