JAL-3444 missed commit of removal of object creation test.
[jalview.git] / src / jalview / structure / StructureSelectionManager.java
index e7835f3..82d66f2 100644 (file)
@@ -86,7 +86,7 @@ public class StructureSelectionManager implements ApplicationSingletonI
   /*
    * instances of this class scoped by some context class
    */
-  private IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager> structureSelections;
+  private IdentityHashMap<StructureSelectionManagerProvider, StructureSelectionManager> selectionManagers;
 
   /**
    * Answers an instance of this class for the current application (Java or JS
@@ -116,7 +116,8 @@ public class StructureSelectionManager implements ApplicationSingletonI
   /**
    * Answers an instance of this class scoped to the given context. The instance
    * is created on the first request for the context, thereafter the same
-   * instance is returned.
+   * instance is returned. Note that the context may be null (this is the case
+   * when running headless without a Desktop).
    * 
    * @param context
    * @return
@@ -124,11 +125,11 @@ public class StructureSelectionManager implements ApplicationSingletonI
   StructureSelectionManager getInstanceForContext(
           StructureSelectionManagerProvider context)
   {
-    StructureSelectionManager instance = structureSelections.get(context);
+    StructureSelectionManager instance = selectionManagers.get(context);
     if (instance == null)
     {
       instance = new StructureSelectionManager();
-      structureSelections.put(context, instance);
+      selectionManagers.put(context, instance);
     }
     return instance;
   }
@@ -141,7 +142,7 @@ public class StructureSelectionManager implements ApplicationSingletonI
 
   public static void release(StructureSelectionManagerProvider provider)
   {
-    getInstance().structureSelections.remove(provider);
+    getInstance().selectionManagers.remove(provider);
   }
 
   /**
@@ -150,7 +151,7 @@ public class StructureSelectionManager implements ApplicationSingletonI
    */
   private StructureSelectionManager()
   {
-    structureSelections = new IdentityHashMap<>();
+    selectionManagers = new IdentityHashMap<>();
   }
 
   /**