Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2009-07-10 20:45:18 +0000
committerAndrew Niefer2009-07-10 20:45:18 +0000
commitc66a5a9bc54779a36160ac44cc0adc04318ee771 (patch)
treef810d60304fa373cb315ee0948b857d8ab520a15
parenta341a3f30ad2d12525bfe8ce55605d117b110d49 (diff)
downloadrt.equinox.framework-c66a5a9bc54779a36160ac44cc0adc04318ee771.tar.gz
rt.equinox.framework-c66a5a9bc54779a36160ac44cc0adc04318ee771.tar.xz
rt.equinox.framework-c66a5a9bc54779a36160ac44cc0adc04318ee771.zip
bug 282704 - EclipsePolicy assumes non-null CodeSource
-rw-r--r--bundles/org.eclipse.equinox.launcher/src/org/eclipse/equinox/launcher/Main.java13
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.

Back to the top