Small improvement, make member field final.
authorDavid Bosschaert <davidb@apache.org>
Tue, 30 May 2017 15:28:38 +0000 (16:28 +0100)
committerDavid Bosschaert <davidb@apache.org>
Tue, 30 May 2017 15:28:38 +0000 (16:28 +0100)
containers-docker-local/src/main/java/org/apache/aries/containers/docker/local/impl/LocalDockerServiceManager.java

index be91761..c64e99a 100644 (file)
@@ -60,13 +60,16 @@ public class LocalDockerServiceManager implements ServiceManager {
             : "localhost";
 
 
-    private volatile LocalDockerController docker;
+    private final LocalDockerController docker;
     private final ConcurrentMap<String, Service> services =
             new ConcurrentHashMap<>();
 
     public LocalDockerServiceManager() {
-        if (docker == null)
-            docker = new LocalDockerController();
+        this(new LocalDockerController());
+    }
+
+    LocalDockerServiceManager(LocalDockerController docker) {
+        this.docker = docker;
     }
 
     List<String> getDockerIDs(ServiceConfig config) {