diff options
author | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-22 16:19:10 +0000 |
---|---|---|
committer | lresende <lresende@13f79535-47bb-0310-9956-ffa450edef68> | 2009-05-22 16:19:10 +0000 |
commit | 79b77adb8fef08386ee640cd7fe41e845f34093d (patch) | |
tree | 7cf8c7960a6ff00e2d87c5dc0cf35ed4cd51b631 /branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany | |
parent | b276ba83f775c0e1ce8d1a271b9b0727f66f433a (diff) |
Merging changes from 1.5 release branch to avoid NPE when running some samples
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@777599 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany')
2 files changed, 14 insertions, 18 deletions
diff --git a/branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany/sca/policy/security/http/LDAPRealmAuthenticationImplementationPolicyProvider.java b/branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany/sca/policy/security/http/LDAPRealmAuthenticationImplementationPolicyProvider.java index bb1950f7f8..88f153c064 100644 --- a/branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany/sca/policy/security/http/LDAPRealmAuthenticationImplementationPolicyProvider.java +++ b/branches/sca-java-1.x/modules/policy-security-http/src/main/java/org/apache/tuscany/sca/policy/security/http/LDAPRealmAuthenticationImplementationPolicyProvider.java @@ -71,7 +71,7 @@ public class LDAPRealmAuthenticationImplementationPolicyProvider implements Poli if (implementation instanceof OperationsConfigurator) { OperationsConfigurator operationsConfigurator = (OperationsConfigurator)implementation; for (ConfiguredOperation cop : operationsConfigurator.getConfiguredOperations()) { - if (cop.getName().equals(op.getName())) { + if (cop != null && cop.getName() != null && cop.getName().equals(op.getName())) { for (PolicySet ps : cop.getPolicySets()) { for (Object p : ps.getPolicies()) { if (LDAPRealmAuthenticationPolicy.class.isInstance(p)) { @@ -99,7 +99,7 @@ public class LDAPRealmAuthenticationImplementationPolicyProvider implements Poli if (implementation instanceof OperationsConfigurator) { OperationsConfigurator operationsConfigurator = (OperationsConfigurator)implementation; for (ConfiguredOperation cop : operationsConfigurator.getConfiguredOperations()) { - if (cop.getName().equals(op.getName())) { + if (cop != null && cop.getName() != null && cop.getName().equals(op.getName())) { for (PolicySet ps : cop.getPolicySets()) { for (Object p : ps.getPolicies()) { if (AuthorizationPolicy.class.isInstance(p)) { 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 4b2bb1ad1c..6189de5a5a 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,13 +89,11 @@ 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!= 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); - } + if (operation!= null && operation.getName() != null && operation.getName().equals(op.getName())) { + for (PolicySet ps : operation.getPolicySets()) { + for (Object p : ps.getPolicies()) { + if (LDAPRealmAuthenticationPolicy.class.isInstance(p)) { + polices.add((LDAPRealmAuthenticationPolicy)p); } } } @@ -105,7 +103,7 @@ public class LDAPRealmAuthenticationServicePolicyProvider implements PolicyProvi if (service instanceof OperationsConfigurator) { OperationsConfigurator operationsConfigurator = (OperationsConfigurator)service; for (ConfiguredOperation cop : operationsConfigurator.getConfiguredOperations()) { - if (cop.getName().equals(op.getName())) { + if (cop!= null && cop.getName() != null && cop.getName().equals(op.getName())) { for (PolicySet ps : cop.getApplicablePolicySets()) { for (Object p : ps.getPolicies()) { if (LDAPRealmAuthenticationPolicy.class.isInstance(p)) { @@ -138,13 +136,11 @@ 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!= 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); - } + if (operation!= null && operation.getName() != null && operation.getName().equals(op.getName())) { + for (PolicySet ps : operation.getPolicySets()) { + for (Object p : ps.getPolicies()) { + if (AuthorizationPolicy.class.isInstance(p)) { + polices.add((AuthorizationPolicy)p); } } } @@ -154,7 +150,7 @@ public class LDAPRealmAuthenticationServicePolicyProvider implements PolicyProvi if (service instanceof OperationsConfigurator) { OperationsConfigurator operationsConfigurator = (OperationsConfigurator)service; for (ConfiguredOperation cop : operationsConfigurator.getConfiguredOperations()) { - if (cop.getName().equals(op.getName())) { + if (cop != null && cop.getName() != null && cop.getName().equals(op.getName())) { for (PolicySet ps : cop.getApplicablePolicySets()) { for (Object p : ps.getPolicies()) { if (AuthorizationPolicy.class.isInstance(p)) { |