You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2012/03/11 10:10:27 UTC

svn commit: r1299342 - /axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java

Author: veithen
Date: Sun Mar 11 09:10:27 2012
New Revision: 1299342

URL: http://svn.apache.org/viewvc?rev=1299342&view=rev
Log:
Code simplification: the iterator produced by getChildElements always returns OMElement objects.

Modified:
    axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java

Modified: axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java
URL: http://svn.apache.org/viewvc/axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java?rev=1299342&r1=1299341&r2=1299342&view=diff
==============================================================================
--- axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java (original)
+++ axis/axis2/java/rampart/trunk/modules/rampart-trust/src/main/java/org/apache/rahas/client/STSClient.java Sun Mar 11 09:10:27 2012
@@ -681,18 +681,16 @@ public class STSClient {
 
             Iterator templateChildren = rstTemplate.getChildElements();
             while (templateChildren.hasNext()) {
-                OMNode child = (OMNode) templateChildren.next();
+                OMElement child = (OMElement) templateChildren.next();
                 rst.addChild(child);
                 //Look for the key size element
-                if (child instanceof OMElement
-                    && ((OMElement) child).getQName().equals(
+                if (child.getQName().equals(
                         new QName(TrustUtil.getWSTNamespace(this.version),
                                   RahasConstants.IssuanceBindingLocalNames.KEY_SIZE))) {
                     log.debug("Extracting key size from the RSTTemplate: ");
-                    OMElement childElem = (OMElement) child;
                     this.keySize =
-                            (childElem.getText() != null && !"".equals(childElem.getText())) ?
-                            Integer.parseInt(childElem.getText()) :
+                            (child.getText() != null && !"".equals(child.getText())) ?
+                            Integer.parseInt(child.getText()) :
                             -1;
                     if (log.isDebugEnabled()) {
                         log.debug("Key size from RSTTemplate: " + this.keySize);