cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf-fediz git commit: Code cleanup
Date Wed, 12 Apr 2017 10:07:51 GMT
Repository: cxf-fediz
Updated Branches:
  refs/heads/master a04bb93e7 -> 9f947a416


Code cleanup


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

Branch: refs/heads/master
Commit: 9f947a41685a0e80118a11f4e974b92246f61291
Parents: a04bb93
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Wed Apr 12 11:07:44 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Wed Apr 12 11:07:44 2017 +0100

----------------------------------------------------------------------
 .../cxf/fediz/core/handler/LogoutHandler.java   | 27 +++++++++-----------
 .../core/processor/FederationProcessorImpl.java | 27 +++++++++-----------
 2 files changed, 24 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/9f947a41/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/LogoutHandler.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/LogoutHandler.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/LogoutHandler.java
index 2ffcad3..d87a383 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/LogoutHandler.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/handler/LogoutHandler.java
@@ -126,24 +126,21 @@ public class LogoutHandler implements RequestHandler<Boolean>
{
         writeLogoutImage(response);
         return true;
     }
-    
-    private Pattern resolveLogoutRedirectToConstraint(HttpServletRequest request, FedizContext
config) 
+
+    private Pattern resolveLogoutRedirectToConstraint(HttpServletRequest request, FedizContext
config)
         throws IOException, UnsupportedCallbackException {
         Object logoutConstraintObj = config.getLogoutRedirectToConstraint();
-        Pattern logoutConstraint = null;
-        if (logoutConstraintObj != null) {
-            if (logoutConstraintObj instanceof Pattern) {
-                logoutConstraint = (Pattern)logoutConstraintObj;
-            } else if (logoutConstraintObj instanceof CallbackHandler) {
-                CallbackHandler frCB = (CallbackHandler)logoutConstraintObj;
-                ReplyConstraintCallback callback = new ReplyConstraintCallback(request);
-                frCB.handle(new Callback[] {
-                    callback
-                });
-                logoutConstraint = callback.getReplyConstraint();
-            }
+        if (logoutConstraintObj instanceof Pattern) {
+            return (Pattern)logoutConstraintObj;
+        } else if (logoutConstraintObj instanceof CallbackHandler) {
+            CallbackHandler frCB = (CallbackHandler)logoutConstraintObj;
+            ReplyConstraintCallback callback = new ReplyConstraintCallback(request);
+            frCB.handle(new Callback[] {
+                                        callback
+            });
+            return callback.getReplyConstraint();
         }
-        return logoutConstraint;
+        return null;
     }
 
     public void setToken(Element token) {

http://git-wip-us.apache.org/repos/asf/cxf-fediz/blob/9f947a41/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
----------------------------------------------------------------------
diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
index 5c9ae88..06e341b 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/FederationProcessorImpl.java
@@ -586,24 +586,21 @@ public class FederationProcessorImpl extends AbstractFedizProcessor
{
         }
         return signInQuery;
     }
-    
-    private Pattern resolveLogoutRedirectToConstraint(HttpServletRequest request, FedizContext
config) 
+
+    private Pattern resolveLogoutRedirectToConstraint(HttpServletRequest request, FedizContext
config)
         throws IOException, UnsupportedCallbackException {
         Object logoutConstraintObj = config.getLogoutRedirectToConstraint();
-        Pattern logoutConstraint = null;
-        if (logoutConstraintObj != null) {
-            if (logoutConstraintObj instanceof Pattern) {
-                logoutConstraint = (Pattern)logoutConstraintObj;
-            } else if (logoutConstraintObj instanceof CallbackHandler) {
-                CallbackHandler frCB = (CallbackHandler)logoutConstraintObj;
-                ReplyConstraintCallback callback = new ReplyConstraintCallback(request);
-                frCB.handle(new Callback[] {
-                    callback
-                });
-                logoutConstraint = callback.getReplyConstraint();
-            }
+        if (logoutConstraintObj instanceof Pattern) {
+            return (Pattern)logoutConstraintObj;
+        } else if (logoutConstraintObj instanceof CallbackHandler) {
+            CallbackHandler frCB = (CallbackHandler)logoutConstraintObj;
+            ReplyConstraintCallback callback = new ReplyConstraintCallback(request);
+            frCB.handle(new Callback[] {
+                                        callback
+            });
+            return callback.getReplyConstraint();
         }
-        return logoutConstraint;
+        return null;
     }
 
     private String resolveSignOutQuery(HttpServletRequest request, FedizContext config) throws
IOException,


Mime
View raw message