cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/4] git commit: Avoiding NPE if either a location/wsdlLocation is not configured on the STSClient
Date Thu, 26 Jun 2014 14:27:44 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes ce572e409 -> aaf7e6638


Avoiding NPE if either a location/wsdlLocation is not configured on the STSClient


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0c0e20af
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0c0e20af
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0c0e20af

Branch: refs/heads/2.7.x-fixes
Commit: 0c0e20af7cbd57af64584535aa6312e1ec9fcb07
Parents: ce572e4
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Thu Jun 26 11:10:49 2014 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Thu Jun 26 15:22:23 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java | 4 +++-
 .../java/org/apache/cxf/ws/security/trust/Messages.properties    | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0c0e20af/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
index f2cda23..68b36b6 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java
@@ -638,11 +638,13 @@ public abstract class AbstractSTSClient implements Configurable, InterceptorProv
             EndpointInfo ei = service.getEndpointInfo(endpointName);
             Endpoint endpoint = new EndpointImpl(bus, service, ei);
             client = new ClientImpl(bus, endpoint);
-        } else {
+        } else if (location != null) {
             Endpoint endpoint = STSUtils.createSTSEndpoint(bus, namespace, null, location,
soapVersion,
                                                            policy, endpointName);
 
             client = new ClientImpl(bus, endpoint);
+        } else {
+            throw new TrustException(LOG, "NO_LOCATION");
         }
         
         client.getInFaultInterceptors().addAll(inFault);

http://git-wip-us.apache.org/repos/asf/cxf/blob/0c0e20af/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
index d301c27..570dacd 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/Messages.properties
@@ -27,3 +27,4 @@ VALIDATION_FAILED=Validation of security token failed: {0}
 NO_USER_PASSWORD=No user name and/or password is available, name: {0}, password: {1}
 ADDRESS_NOT_MATCHED=Cannot match the address {0} to the WSDL received via WS-MEX
 WS_MEX_ERROR=Exception when trying to retrieve/process a WSDL via WS-MEX
+NO_LOCATION=The STSClient is not configured with either a location or wsdlLocation property


Mime
View raw message