diff --git a/src/se/hal/ControllerManager.java b/src/se/hal/ControllerManager.java index 50fb459e..2c06f40f 100755 --- a/src/se/hal/ControllerManager.java +++ b/src/se/hal/ControllerManager.java @@ -32,21 +32,21 @@ public class ControllerManager implements HalSensorReportListener, /** All available sensor plugins **/ private List> availableSensors = new ArrayList<>(); /** List of all registered sensors **/ - private List registeredSensors = new ArrayList<>(); + private List registeredSensors = Collections.synchronizedList(new ArrayList()); /** List of auto detected sensors **/ - private List detectedSensors = new ArrayList<>(); + private List detectedSensors = Collections.synchronizedList(new ArrayList()); /** List of sensors that are currently being reconfigured **/ - private List limboSensors = new LinkedList<>(); + private List limboSensors = Collections.synchronizedList(new LinkedList()); /** All available event plugins **/ private List> availableEvents = new ArrayList<>(); /** List of all registered events **/ - private List registeredEvents = new ArrayList<>(); + private List registeredEvents = Collections.synchronizedList(new ArrayList()); /** List of auto detected events **/ - private List detectedEvents = new ArrayList<>(); + private List detectedEvents = Collections.synchronizedList(new ArrayList()); /** List of all registered events **/ - private List limboEvents = new LinkedList<>(); + private List limboEvents = Collections.synchronizedList(new LinkedList()); /** A map of all instantiated controllers **/ @@ -134,7 +134,8 @@ public class ControllerManager implements HalSensorReportListener, } private static Sensor findSensor(HalSensorData sensorData, List list){ - for (Sensor s : list) { + for (int i=0; i list){ - for (Event e : list) { + for (int i=0; i registeredDevices; + private List registeredDevices; public TellstickSerialComm() { set = new TimedHashSet(TRANSMISSION_UNIQUENESS_TTL); parser = new TellstickParser(); - registeredDevices = new ArrayList<>(); + registeredDevices = Collections.synchronizedList(new ArrayList()); } @Override @@ -133,7 +135,8 @@ public class TellstickSerialComm implements Runnable, //Check for registered device that are in the same group if(protocol instanceof TellstickGroupProtocol) { TellstickGroupProtocol groupProtocol = (TellstickGroupProtocol) protocol; - for (TellstickProtocol childProtocol : registeredDevices) { + for (int i=0; i extends DBBean { if(data != null) { deviceData = data; type = data.getClass().getName(); - applyConfig(); + applyConfig(); // TODO: this is a bit clunky, should probably be solved in another way } else { deviceData = null; type = null;