JAL-3907 Remove no longer used SecurityManager. Will replace functionality with...
authorBen Soares <b.soares@dundee.ac.uk>
Thu, 28 Nov 2024 09:59:08 +0000 (09:59 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Thu, 28 Nov 2024 09:59:08 +0000 (09:59 +0000)
src/jalview/bin/Jalview.java
src/jalview/io/AppletFormatAdapter.java

index 8bddae3..c057aee 100755 (executable)
@@ -35,11 +35,6 @@ import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.security.AllPermission;
-import java.security.CodeSource;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.security.Policy;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -154,34 +149,6 @@ public class Jalview implements JalviewObjectI
     return Jalview.getInstance() != null && Jalview.getInstance().QUIET;
   }
 
-  static
-  {
-    if (!Platform.isJS())
-    /**
-     * Java only
-     * 
-     * @j2sIgnore
-     */
-    {
-      // grab all the rights we can for the JVM
-      Policy.setPolicy(new Policy()
-      {
-        @Override
-        public PermissionCollection getPermissions(CodeSource codesource)
-        {
-          Permissions perms = new Permissions();
-          perms.add(new AllPermission());
-          return (perms);
-        }
-
-        @Override
-        public void refresh()
-        {
-        }
-      });
-    }
-  }
-
   /**
    * keep track of feature fetching tasks.
    * 
@@ -304,11 +271,6 @@ public class Jalview implements JalviewObjectI
    */
   void doMain(String[] args)
   {
-    if (!Platform.isJS())
-    {
-      System.setSecurityManager(null);
-    }
-
     if (args == null || args.length == 0 || (args.length == 1
             && (args[0] == null || args[0].length() == 0)))
     {
index 8b7a4c2..7019b39 100755 (executable)
@@ -571,7 +571,7 @@ public class AppletFormatAdapter
     try
     {
       boolean rtn = false;
-      InputStream is = System.getSecurityManager().getClass()
+      InputStream is = AppletFormatAdapter.class.getClassLoader()
               .getResourceAsStream("/" + file);
       if (is != null)
       {