cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [2/6] cxf git commit: Simplifying some code in TokenIssueOperation
Date Wed, 10 Feb 2016 17:24:12 GMT
Simplifying some code in TokenIssueOperation


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

Branch: refs/heads/master
Commit: 456ed68184cbed93c3f56c2ceb5d649415f98b22
Parents: 5f038c2
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Feb 10 14:35:14 2016 +0000
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Feb 10 17:22:02 2016 +0000

----------------------------------------------------------------------
 .../cxf/sts/operation/TokenIssueOperation.java  | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/456ed681/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
----------------------------------------------------------------------
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
index a2513ef..d6fb5e8 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/operation/TokenIssueOperation.java
@@ -281,21 +281,15 @@ public class TokenIssueOperation extends AbstractOperation implements
IssueOpera
             QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityTokenType();
         JAXBElement<RequestedSecurityTokenType> requestedToken = 
             QNameConstants.WS_TRUST_FACTORY.createRequestedSecurityToken(requestedTokenType);
-        LOG.fine("Encrypting Issued Token: " + encryptIssuedToken);
-        if (encryptIssuedToken) {
-            requestedTokenType.setAny(tokenResponse.getToken());
-            response.getAny().add(requestedToken);
+        if (tokenResponse.getToken() instanceof String) {
+            Document doc = DOMUtils.newDocument();
+            Element tokenWrapper = doc.createElementNS(null, "TokenWrapper");
+            tokenWrapper.setTextContent((String)tokenResponse.getToken());
+            requestedTokenType.setAny(tokenWrapper);
         } else {
-            if (tokenResponse.getToken() instanceof String) {
-                Document doc = DOMUtils.newDocument();
-                Element tokenWrapper = doc.createElementNS(null, "TokenWrapper");
-                tokenWrapper.setTextContent((String)tokenResponse.getToken());
-                requestedTokenType.setAny(tokenWrapper);
-            } else {
-                requestedTokenType.setAny(tokenResponse.getToken());
-            }
-            response.getAny().add(requestedToken);
+            requestedTokenType.setAny(tokenResponse.getToken());
         }
+        response.getAny().add(requestedToken);
 
         if (returnReferences) {
             // RequestedAttachedReference


Mime
View raw message