Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 61E849039 for ; Mon, 28 May 2012 19:36:58 +0000 (UTC) Received: (qmail 31020 invoked by uid 500); 28 May 2012 19:36:58 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 30915 invoked by uid 500); 28 May 2012 19:36:58 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 30908 invoked by uid 99); 28 May 2012 19:36:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 May 2012 19:36:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 May 2012 19:36:56 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C939B238896F; Mon, 28 May 2012 19:36:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1343372 - in /cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core: FederationProcessorImpl.java config/FederationProtocol.java Date: Mon, 28 May 2012 19:36:36 -0000 To: commits@cxf.apache.org From: owulff@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120528193636.C939B238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: owulff Date: Mon May 28 19:36:36 2012 New Revision: 1343372 URL: http://svn.apache.org/viewvc?rev=1343372&view=rev Log: NullPointerException in createSignInRequest fixed Modified: cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java Modified: cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java?rev=1343372&r1=1343371&r2=1343372&view=diff ============================================================================== --- cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java (original) +++ cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/FederationProcessorImpl.java Mon May 28 19:36:36 2012 @@ -272,28 +272,32 @@ public class FederationProcessorImpl imp Object wAuthObj = ((FederationProtocol)config.getProtocol()).getAuthenticationType(); String wAuth = null; - if (wAuthObj instanceof String) { - wAuth = (String)wAuthObj; - } else if (wAuthObj instanceof CallbackHandler) { - CallbackHandler wauthCB = (CallbackHandler)wAuthObj; - WAuthCallback callback = new WAuthCallback(request); - wauthCB.handle(new Callback[] {callback}); - wAuth = callback.getWauth(); + if (wAuthObj != null) { + if (wAuthObj instanceof String) { + wAuth = (String)wAuthObj; + } else if (wAuthObj instanceof CallbackHandler) { + CallbackHandler wauthCB = (CallbackHandler)wAuthObj; + WAuthCallback callback = new WAuthCallback(request); + wauthCB.handle(new Callback[] {callback}); + wAuth = callback.getWauth(); + } } LOG.info("WAuth: " + wAuth); Object homeRealmObj = ((FederationProtocol)config.getProtocol()).getHomeRealm(); String homeRealm = null; - if (homeRealmObj instanceof String) { - homeRealm = (String)homeRealmObj; - } else if (homeRealmObj instanceof CallbackHandler) { - CallbackHandler hrCB = (CallbackHandler)homeRealmObj; - HomeRealmCallback callback = new HomeRealmCallback(request); - hrCB.handle(new Callback[] {callback}); - homeRealm = callback.getHomeRealm(); + if (homeRealmObj != null) { + if (homeRealmObj instanceof String) { + homeRealm = (String)homeRealmObj; + } else if (homeRealmObj instanceof CallbackHandler) { + CallbackHandler hrCB = (CallbackHandler)homeRealmObj; + HomeRealmCallback callback = new HomeRealmCallback(request); + hrCB.handle(new Callback[] {callback}); + homeRealm = callback.getHomeRealm(); + } } LOG.info("HomeRealm: " + homeRealm); - + StringBuilder sb = new StringBuilder(); sb.append(FederationConstants.PARAM_ACTION).append('=').append(FederationConstants.ACTION_SIGNIN); Modified: cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java URL: http://svn.apache.org/viewvc/cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java?rev=1343372&r1=1343371&r2=1343372&view=diff ============================================================================== --- cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java (original) +++ cxf/fediz/trunk/plugins/core/src/main/java/org/apache/cxf/fediz/core/config/FederationProtocol.java Mon May 28 19:36:36 2012 @@ -89,7 +89,10 @@ public class FederationProtocol extends return this.authenticationType; } CallbackType cbt = getFederationProtocol().getAuthenticationType(); - if (cbt.getType().equals(ArgumentType.STRING)) { + if (cbt == null) { + return null; + } + if (cbt.getType() == null || cbt.getType().equals(ArgumentType.STRING)) { this.authenticationType = new String(cbt.getValue()); } else if (cbt.getType().equals(ArgumentType.CLASS)) { try { @@ -123,7 +126,10 @@ public class FederationProtocol extends return this.homeRealm; } CallbackType cbt = getFederationProtocol().getHomeRealm(); - if (cbt.getType().equals(ArgumentType.STRING)) { + if (cbt == null) { + return null; + } + if (cbt.getType() == null || cbt.getType().equals(ArgumentType.STRING)) { this.homeRealm = new String(cbt.getValue()); } else if (cbt.getType().equals(ArgumentType.CLASS)) { try { @@ -157,7 +163,7 @@ public class FederationProtocol extends return this.issuer; } CallbackType cbt = getFederationProtocol().getIssuer(); - if (cbt.getType().equals(ArgumentType.STRING)) { + if (cbt.getType() == null || cbt.getType().equals(ArgumentType.STRING)) { this.issuer = new String(cbt.getValue()); } else if (cbt.getType().equals(ArgumentType.CLASS)) { try {