Skip to content

Commit c02b819

Browse files
committed
silently add already existing device
1 parent 34e5e0d commit c02b819

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/processing/mode/android/Devices.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,11 @@ private void addDevice(final Device device) {
298298
try {
299299
device.initialize();
300300
if (devices.put(device.getId(), device) != null) {
301-
throw new IllegalStateException("Adding " + device
302-
+ ", which already exists!");
301+
// TODO: Silently add existing device, this may be indicating, like in
302+
// deviceRemoved() below, different threads trying to add the same
303+
// device. Does not seem to have any negative effect.
304+
// throw new IllegalStateException("Adding " + device
305+
// + ", which already exists!");
303306
}
304307
} catch (final Exception e) {
305308
System.err.println("While initializing " + device.getId() + ": " + e);

0 commit comments

Comments
 (0)