JAL-3560 rewritten Platform with JSUtilI interface
[jalview.git] / src / jalview / bin / ApplicationSingletonProvider.java
index b64f40c..1b90259 100644 (file)
@@ -80,21 +80,13 @@ public class ApplicationSingletonProvider
    * 
    * @return
    */
+  @SuppressWarnings("unchecked")
   private static Map<Class<? extends ApplicationSingletonI>, ApplicationSingletonI> getContextMap()
   {
-    @SuppressWarnings("unused")
-    ThreadGroup g = (Platform.isJS()
-            ? Thread.currentThread().getThreadGroup()
-            : null);
-    Map<Class<? extends ApplicationSingletonI>, ApplicationSingletonI> map = singletons;
-    /** @j2sNative map = g._swingjsSingletons; */
-    if (map == null)
-    {
-      map = new HashMap<>();
-      /** @j2sNative g._swingjsSingletons = map; */
-    }
-
-    return map;
+    return (Platform.isJS()
+            ? (Map<Class<? extends ApplicationSingletonI>, ApplicationSingletonI>) Platform
+                    .getJSSingletons()
+            : singletons);
   }
 
   /**