From f1f306f9af0fb1643345831b8880aebb526a5f61 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 28 Nov 2024 09:59:08 +0000 Subject: [PATCH] JAL-3907 Remove no longer used SecurityManager. Will replace functionality with snyk --- src/jalview/bin/Jalview.java | 38 ------------------------------- src/jalview/io/AppletFormatAdapter.java | 2 +- 2 files changed, 1 insertion(+), 39 deletions(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 8bddae3..c057aee 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -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))) { diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 8b7a4c2..7019b39 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -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) { -- 1.7.10.2