diff options
author | Andrew Niefer | 2009-07-10 20:49:13 +0000 |
---|---|---|
committer | Andrew Niefer | 2009-07-10 20:49:13 +0000 |
commit | ba1ab28816d4a41a0bff1c99a6031014015c7002 (patch) | |
tree | 218c370ccd562a28e9b29885e9779110deac2720 /bundles/org.eclipse.equinox.launcher | |
parent | 7c9e9590abc8503629e2efcd94fb64e0d1d9ec1e (diff) | |
download | rt.equinox.framework-ba1ab28816d4a41a0bff1c99a6031014015c7002.tar.gz rt.equinox.framework-ba1ab28816d4a41a0bff1c99a6031014015c7002.tar.xz rt.equinox.framework-ba1ab28816d4a41a0bff1c99a6031014015c7002.zip |
bug 282704 - EclipsePolicy assumes non-null CodeSource
Diffstat (limited to 'bundles/org.eclipse.equinox.launcher')
-rw-r--r-- | bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java index e96e9583b..88801d2ed 100644 --- a/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java +++ b/bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java @@ -2483,19 +2483,19 @@ public class Main { } public PermissionCollection getPermissions(CodeSource codesource) { - if (contains(codesource.getLocation())) + if (contains(codesource)) return allPermissions; return policy == null ? allPermissions : policy.getPermissions(codesource); } public PermissionCollection getPermissions(ProtectionDomain domain) { - if (contains(domain.getCodeSource().getLocation())) + if (contains(domain.getCodeSource())) return allPermissions; return policy == null ? allPermissions : policy.getPermissions(domain); } public boolean implies(ProtectionDomain domain, Permission permission) { - if (contains(domain.getCodeSource().getLocation())) + if (contains(domain.getCodeSource())) return true; return policy == null ? true : policy.implies(domain, permission); } @@ -2505,7 +2505,12 @@ public class Main { policy.refresh(); } - private boolean contains(URL url) { + private boolean contains(CodeSource codeSource) { + if (codeSource == null) + return false; + URL url = codeSource.getLocation(); + if (url == null) + return false; // Check to see if this URL is in our set of URLs to give AllPermissions to. for (int i = 0; i < urls.length; i++) { // We do simple equals test here because we assume the URLs will be the same objects. |