import jalview.structure.StructureImportSettings;
import jalview.structure.StructureSelectionManager;
import jalview.urls.IdOrgSettings;
+import jalview.util.Platform;
import jalview.ws.jws1.Discoverer;
import jalview.ws.jws2.Jws2Discoverer;
import jalview.ws.jws2.jabaws2.Jws2InstanceFactory;
*/
public static Instance getInstance()
{
- Instance i;
+
+ // assign g only if JavaScript and instance only if Java
+
@SuppressWarnings("unused")
- ThreadGroup g = Thread.currentThread().getThreadGroup();
- /**
- * @j2sNative i = g._jalviewInstance;
- */
- {
- i = instance;
- }
+ ThreadGroup g = (Platform.isJS()
+ ? Thread.currentThread().getThreadGroup()
+ : null);
+ Instance i = /** @j2sNative g._jalviewInstance || */
+ instance;
if (i == null)
{
- i = instance = new Instance();
- /**
- * @j2sNative g._jalviewInstance = i;
- */
+ i = /**
+ * @j2sNative g._jalviewInstance =
+ */
+ new Instance();
+ instance = /** @j2sNative null && */
+ i;
}
return i;
}