Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2018-05-09 11:55:49 -0400
committerThomas Watson2018-06-06 08:45:01 -0400
commita918c73fb6938e79ccb714004540aa4252788a8e (patch)
tree16c70b8e1b01233ff19aa0c134c58a9292aca287 /bundles/org.eclipse.osgi
parentebe89f1f5f0cfe2a9c5a830ec8ad676dc0058785 (diff)
downloadrt.equinox.framework-a918c73fb6938e79ccb714004540aa4252788a8e.tar.gz
rt.equinox.framework-a918c73fb6938e79ccb714004540aa4252788a8e.tar.xz
rt.equinox.framework-a918c73fb6938e79ccb714004540aa4252788a8e.zip
Bug 532194 - Use BundlePermissions for the EvaluationCacheKey
Also check for null Conditions from a row and update testcase to handle when multiple conditions are used in a single row. If there is a mix of mutable and immutable conditions then the satisfied conditions are nulled out to avoid calling them again on future permission checkes. The method checkMutable needs to handle the null values. Change-Id: I9adf9cf54bfe571d53049d48ffb44e76bc78f121 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.osgi')
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/EvaluationCacheKey.java8
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTable.java2
2 files changed, 5 insertions, 5 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/EvaluationCacheKey.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/EvaluationCacheKey.java
index d0db72521..f59472545 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/EvaluationCacheKey.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/EvaluationCacheKey.java
@@ -17,11 +17,11 @@ class EvaluationCacheKey {
private final Permission permission;
- private final Long bundleId;
+ private final BundlePermissions bundlePermissions;
EvaluationCacheKey(BundlePermissions bundlePermissions, Permission permission) {
this.permission = permission;
- this.bundleId = bundlePermissions.getBundle().getBundleId();
+ this.bundlePermissions = bundlePermissions;
}
@Override
@@ -33,11 +33,11 @@ class EvaluationCacheKey {
return false;
}
EvaluationCacheKey that = (EvaluationCacheKey) o;
- return Objects.equals(bundleId, that.bundleId) && Objects.equals(permission, that.permission);
+ return bundlePermissions == that.bundlePermissions && Objects.equals(permission, that.permission);
}
@Override
public int hashCode() {
- return Objects.hash(bundleId, permission);
+ return Objects.hash(bundlePermissions, permission);
}
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTable.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTable.java
index 6a93c53d2..a084b889b 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTable.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/SecurityTable.java
@@ -111,7 +111,7 @@ public class SecurityTable extends PermissionCollection {
Condition[] conditions = row.getConditions(bundlePermissions);
if (conditions != null) {
for (Condition condition : conditions) {
- if (condition.isMutable()) {
+ if (condition != null && condition.isMutable()) {
evaluationCache.put(evaluationCacheKey, MUTABLE);
return true;
}

Back to the top