Community
Participate
Eclipse IDE
In the case where there are conditions that start as mutable and later become immutable, ConditionalPermissions.implies should check the conditions array returned from getNeededConditions for null. Condition conds[] = cpsArray[i].getNeededConditions(); -> if (conds == null) continue cpsLoop; There is a test in org.osgi.test.cases.permissionadmin.conditional that checks this scenario. java.lang.NullPointerException at org.eclipse.osgi.framework.internal.core.ConditionalPermissions.implies (ConditionalPermissions.java:136) at org.eclipse.osgi.framework.internal.core.BundleCombinedPermissions.implies (BundleCombinedPermissions.java:190) at java.security.ProtectionDomain.implies(ProtectionDomain.java:193) at java.security.AccessControlContext.checkPermission (AccessControlContext.java:254)
Fixed in HEAD. This needs to be fixed in 3.1.1 to pass the R4 TCK.
Created attachment 26802 [details] Fix for 3.1.1 Pascal, please review patch against 3.1.1 maintenance branch. Thanks.
Created attachment 26807 [details] Updated fix The null check for neededConditions should happen before the neededConditions.length check.
Patch reviewed, good to go.
Fixed in HEAD and 3.1 maintenance branch.