diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-22 09:54:08 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-22 09:54:08 +0000 |
commit | 6f6df0fde75eca1c1a4d1423205db6b07916b506 (patch) | |
tree | 6c2612f2c3a86863e36afbcd05112769710a5621 /branches/sca-java-1.x | |
parent | 2e0063cb2a2688378e22c3742243886ed05939b3 (diff) |
Merge policy NPE fixes from 1.5 branch
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@777443 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x')
2 files changed, 21 insertions, 15 deletions
diff --git a/branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany/sca/policy/security/http/LDAPRealmAuthenticationServicePolicyProvider.java b/branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany/sca/policy/security/http/LDAPRealmAuthenticationServicePolicyProvider.java index fe14987948..4b2bb1ad1c 100644 --- a/branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany/sca/policy/security/http/LDAPRealmAuthenticationServicePolicyProvider.java +++ b/branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany/sca/policy/security/http/LDAPRealmAuthenticationServicePolicyProvider.java @@ -89,11 +89,13 @@ public class LDAPRealmAuthenticationServicePolicyProvider implements PolicyProvi List<LDAPRealmAuthenticationPolicy> polices = new ArrayList<LDAPRealmAuthenticationPolicy>(); // FIXME: How do we get a list of effective policySets for a given operation? for(Operation operation : operations) { - if (operation.getName().equals(op.getName())) { - for (PolicySet ps : operation.getPolicySets()) { - for (Object p : ps.getPolicies()) { - if (LDAPRealmAuthenticationPolicy.class.isInstance(p)) { - polices.add((LDAPRealmAuthenticationPolicy)p); + if (operation!= null && operation.getName() != null) { + if (operation.getName().equals(op.getName())) { + for (PolicySet ps : operation.getPolicySets()) { + for (Object p : ps.getPolicies()) { + if (LDAPRealmAuthenticationPolicy.class.isInstance(p)) { + polices.add((LDAPRealmAuthenticationPolicy)p); + } } } } @@ -136,11 +138,13 @@ public class LDAPRealmAuthenticationServicePolicyProvider implements PolicyProvi List<AuthorizationPolicy> polices = new ArrayList<AuthorizationPolicy>(); // FIXME: How do we get a list of effective policySets for a given operation? for(Operation operation : operations) { - if (operation.getName().equals(op.getName())) { - for (PolicySet ps : operation.getPolicySets()) { - for (Object p : ps.getPolicies()) { - if (AuthorizationPolicy.class.isInstance(p)) { - polices.add((AuthorizationPolicy)p); + if (operation!= null && operation.getName() != null) { + if (operation.getName().equals(op.getName())) { + for (PolicySet ps : operation.getPolicySets()) { + for (Object p : ps.getPolicies()) { + if (AuthorizationPolicy.class.isInstance(p)) { + polices.add((AuthorizationPolicy)p); + } } } } diff --git a/branches/sca-java-1.x/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationServicePolicyProvider.java b/branches/sca-java-1.x/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationServicePolicyProvider.java index 19b7d00127..56927be6bb 100644 --- a/branches/sca-java-1.x/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationServicePolicyProvider.java +++ b/branches/sca-java-1.x/modules/policy-security/src/main/java/org/apache/tuscany/sca/policy/security/jaas/JaasAuthenticationServicePolicyProvider.java @@ -57,11 +57,13 @@ public class JaasAuthenticationServicePolicyProvider implements PolicyProvider { List<JaasAuthenticationPolicy> polices = new ArrayList<JaasAuthenticationPolicy>(); // FIXME: How do we get a list of effective policySets for a given operation? for(Operation operation : operations) { - if (operation.getName().equals(op.getName())) { - for (PolicySet ps : operation.getPolicySets()) { - for (Object p : ps.getPolicies()) { - if (JaasAuthenticationPolicy.class.isInstance(p)) { - polices.add((JaasAuthenticationPolicy)p); + if (operation!= null && operation.getName() != null) { + if (operation.getName().equals(op.getName())) { + for (PolicySet ps : operation.getPolicySets()) { + for (Object p : ps.getPolicies()) { + if (JaasAuthenticationPolicy.class.isInstance(p)) { + polices.add((JaasAuthenticationPolicy)p); + } } } } |