Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/Processor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/Processor.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/processor/Processor.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/Processor.java Fri Nov 12 17:29:54 2010 @@ -21,6 +21,7 @@ package org.apache.ws.security.processor import org.apache.ws.security.WSDocInfo; import org.apache.ws.security.WSSConfig; +import org.apache.ws.security.WSSecurityEngineResult; import org.apache.ws.security.WSSecurityException; import org.apache.ws.security.components.crypto.Crypto; import org.w3c.dom.Element; @@ -36,7 +37,7 @@ public interface Processor { Crypto decCrypto, CallbackHandler cb, WSDocInfo wsDocInfo, - List returnResults, + List<WSSecurityEngineResult> returnResults, WSSConfig config ) throws WSSecurityException;
Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java Fri Nov 12 17:29:54 2010 @@ -60,7 +60,7 @@ public class ReferenceListProcessor impl Crypto decCrypto, CallbackHandler cb, WSDocInfo wdi, - List returnResults, + List<WSSecurityEngineResult> returnResults, WSSConfig wsc ) throws WSSecurityException { debug = log.isDebugEnabled(); @@ -70,7 +70,7 @@ public class ReferenceListProcessor impl if (cb == null) { throw new WSSecurityException(WSSecurityException.FAILURE, "noCallback"); } - List dataRefs = handleReferenceList(elem, cb, decCrypto, wdi); + List<WSDataRef> dataRefs = handleReferenceList(elem, cb, decCrypto, wdi); returnResults.add( 0, new WSSecurityEngineResult(WSConstants.ENCR, dataRefs) @@ -85,13 +85,13 @@ public class ReferenceListProcessor impl * @param cb the callback handler to get the key for a key name stored if * <code>KeyInfo</code> inside the encrypted data elements */ - private List handleReferenceList( + private List<WSDataRef> handleReferenceList( Element elem, CallbackHandler cb, Crypto crypto, WSDocInfo wdi ) throws WSSecurityException { - List dataRefs = new Vector(); + List<WSDataRef> dataRefs = new Vector<WSDataRef>(); for (Node node = elem.getFirstChild(); node != null; node = node.getNextSibling() Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/SAMLTokenProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/SAMLTokenProcessor.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/processor/SAMLTokenProcessor.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/SAMLTokenProcessor.java Fri Nov 12 17:29:54 2010 @@ -46,7 +46,7 @@ public class SAMLTokenProcessor implemen Crypto decCrypto, CallbackHandler cb, WSDocInfo wsDocInfo, - List returnResults, + List<WSSecurityEngineResult> returnResults, WSSConfig wsc ) throws WSSecurityException { if (log.isDebugEnabled()) { Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/SecurityContextTokenProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/SecurityContextTokenProcessor.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/processor/SecurityContextTokenProcessor.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/SecurityContextTokenProcessor.java Fri Nov 12 17:29:54 2010 @@ -66,7 +66,7 @@ public class SecurityContextTokenProcess Crypto decCrypto, CallbackHandler cb, WSDocInfo wsDocInfo, - List returnResults, + List<WSSecurityEngineResult> returnResults, WSSConfig config ) throws WSSecurityException { SecurityContextToken sct = new SecurityContextToken(elem); Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureConfirmationProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureConfirmationProcessor.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureConfirmationProcessor.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureConfirmationProcessor.java Fri Nov 12 17:29:54 2010 @@ -44,7 +44,7 @@ public class SignatureConfirmationProces Crypto decCrypto, CallbackHandler cb, WSDocInfo wsDocInfo, - List returnResults, + List<WSSecurityEngineResult> returnResults, WSSConfig wsc ) throws WSSecurityException { if (log.isDebugEnabled()) { Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/SignatureProcessor.java Fri Nov 12 17:29:54 2010 @@ -107,14 +107,14 @@ public class SignatureProcessor implemen Crypto decCrypto, CallbackHandler cb, WSDocInfo wsDocInfo, - List returnResults, + List<WSSecurityEngineResult> returnResults, WSSConfig wsc ) throws WSSecurityException { if (log.isDebugEnabled()) { log.debug("Found signature element"); } boolean remove = WSDocInfoStore.store(wsDocInfo); - List protectedRefs = new java.util.Vector(); + List<WSDataRef> protectedRefs = new java.util.Vector<WSDataRef>(); Principal lastPrincipalFound = null; certs = null; signatureValue = null; @@ -182,7 +182,7 @@ public class SignatureProcessor implemen protected Principal verifyXMLSignature( Element elem, Crypto crypto, - List protectedRefs, + List<WSDataRef> protectedRefs, CallbackHandler cb, WSDocInfo wsDocInfo ) throws WSSecurityException { @@ -437,7 +437,7 @@ public class SignatureProcessor implemen boolean signatureValidationCheck = xmlSignature.getSignatureValue().validate(context); log.debug("Signature Validation check: " + signatureValidationCheck); - java.util.Iterator referenceIterator = + java.util.Iterator<?> referenceIterator = xmlSignature.getSignedInfo().getReferences().iterator(); while (referenceIterator.hasNext()) { Reference reference = (Reference)referenceIterator.next(); @@ -789,7 +789,7 @@ public class SignatureProcessor implemen ) throws MarshalException { XMLStructure keyInfoStructure = new DOMStructure(keyInfoElement); KeyInfo keyInfo = keyInfoFactory.unmarshalKeyInfo(keyInfoStructure); - List list = keyInfo.getContent(); + List<?> list = keyInfo.getContent(); for (int i = 0; i < list.size(); i++) { XMLStructure xmlStructure = (XMLStructure) list.get(i); @@ -841,13 +841,13 @@ public class SignatureProcessor implemen * @return A list of protected references * @throws WSSecurityException */ - private List buildProtectedRefs( + private List<WSDataRef> buildProtectedRefs( Document doc, SignedInfo signedInfo, WSDocInfo wsDocInfo, - List protectedRefs + List<WSDataRef> protectedRefs ) throws WSSecurityException { - List referencesList = signedInfo.getReferences(); + List<?> referencesList = signedInfo.getReferences(); for (int i = 0; i < referencesList.size(); i++) { Reference siRef = (Reference)referencesList.get(i); String uri = siRef.getURI(); @@ -855,7 +855,7 @@ public class SignatureProcessor implemen if (!"".equals(uri)) { Element se = null; - List transformsList = siRef.getTransforms(); + List<?> transformsList = siRef.getTransforms(); for (int j = 0; j < transformsList.size(); j++) { @@ -864,7 +864,7 @@ public class SignatureProcessor implemen if (STRTransform.TRANSFORM_URI.equals(transform.getAlgorithm())) { NodeSetData data = (NodeSetData)siRef.getDereferencedData(); if (data != null) { - java.util.Iterator iter = data.iterator(); + java.util.Iterator<?> iter = data.iterator(); Node securityTokenReference = null; while (iter.hasNext()) { Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/TimestampProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/TimestampProcessor.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/processor/TimestampProcessor.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/TimestampProcessor.java Fri Nov 12 17:29:54 2010 @@ -46,7 +46,7 @@ public class TimestampProcessor implemen Crypto decCrypto, CallbackHandler cb, WSDocInfo wsDocInfo, - List returnResults, + List<WSSecurityEngineResult> returnResults, WSSConfig wsc ) throws WSSecurityException { if (log.isDebugEnabled()) { Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/UsernameTokenProcessor.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/processor/UsernameTokenProcessor.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/processor/UsernameTokenProcessor.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/UsernameTokenProcessor.java Fri Nov 12 17:29:54 2010 @@ -50,7 +50,7 @@ public class UsernameTokenProcessor impl private boolean passwordsAreEncoded; public void handleToken(Element elem, Crypto crypto, Crypto decCrypto, CallbackHandler cb, - WSDocInfo wsDocInfo, List returnResults, WSSConfig wsc) throws WSSecurityException { + WSDocInfo wsDocInfo, List<WSSecurityEngineResult> returnResults, WSSConfig wsc) throws WSSecurityException { if (log.isDebugEnabled()) { log.debug("Found UsernameToken list element"); } Modified: webservices/wss4j/trunk/src/org/apache/ws/security/saml/SAMLIssuerImpl.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/saml/SAMLIssuerImpl.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/saml/SAMLIssuerImpl.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/saml/SAMLIssuerImpl.java Fri Nov 12 17:29:54 2010 @@ -167,7 +167,7 @@ public class SAMLIssuerImpl implements S SAMLAuthenticationStatement.AuthenticationMethod_Password; } Date authInstant = new Date(); - Collection bindings = null; + Collection<?> bindings = null; SAMLSubject subject = new SAMLSubject(nameId, Modified: webservices/wss4j/trunk/src/org/apache/ws/security/saml/SAMLUtil.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/saml/SAMLUtil.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/saml/SAMLUtil.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/saml/SAMLUtil.java Fri Nov 12 17:29:54 2010 @@ -102,7 +102,7 @@ public class SAMLUtil { if (key != null) { return new SAMLKeyInfo(assertion, key); } else { - Iterator statements = assertion.getStatements(); + Iterator<?> statements = assertion.getStatements(); while (statements.hasNext()) { SAMLStatement stmt = (SAMLStatement) statements.next(); if (stmt instanceof SAMLAttributeStatement) { @@ -142,7 +142,7 @@ public class SAMLUtil { try { KeyInfo keyInfo = keyInfoFactory.unmarshalKeyInfo(keyInfoStructure); - List list = keyInfo.getContent(); + List<?> list = keyInfo.getContent(); for (int i = 0; i < list.size(); i++) { XMLStructure xmlStructure = (XMLStructure) list.get(i); @@ -150,7 +150,7 @@ public class SAMLUtil { PublicKey publicKey = ((KeyValue)xmlStructure).getPublicKey(); return new SAMLKeyInfo(assertion, publicKey); } else if (xmlStructure instanceof X509Data) { - List x509Data = ((X509Data)xmlStructure).getContent(); + List<?> x509Data = ((X509Data)xmlStructure).getContent(); for (int j = 0; j < x509Data.size(); j++) { Object x509obj = x509Data.get(j); if (x509obj instanceof X509Certificate) { @@ -205,7 +205,7 @@ public class SAMLUtil { "invalidSAMLToken", new Object[]{"for Signature (cannot parse)"}, e); } SAMLSubjectStatement samlSubjS = null; - Iterator it = assertion.getStatements(); + Iterator<?> it = assertion.getStatements(); while (it.hasNext()) { SAMLObject so = (SAMLObject) it.next(); if (so instanceof SAMLSubjectStatement) { @@ -238,12 +238,12 @@ public class SAMLUtil { try { KeyInfo keyInfo = keyInfoFactory.unmarshalKeyInfo(keyInfoStructure); - List list = keyInfo.getContent(); + List<?> list = keyInfo.getContent(); for (int i = 0; i < list.size(); i++) { XMLStructure xmlStructure = (XMLStructure) list.get(i); if (xmlStructure instanceof X509Data) { - List x509Data = ((X509Data)xmlStructure).getContent(); + List<?> x509Data = ((X509Data)xmlStructure).getContent(); for (int j = 0; j < x509Data.size(); j++) { Object x509obj = x509Data.get(j); if (x509obj instanceof X509Certificate) { Modified: webservices/wss4j/trunk/src/org/apache/ws/security/saml/WSSecSignatureSAML.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/saml/WSSecSignatureSAML.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/saml/WSSecSignatureSAML.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/saml/WSSecSignatureSAML.java Fri Nov 12 17:29:54 2010 @@ -119,13 +119,12 @@ public class WSSecSignatureSAML extends String soapNamespace = WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement()); if (parts == null) { - parts = new Vector(); + parts = new Vector<WSEncryptionPart>(); WSEncryptionPart encP = new WSEncryptionPart(WSConstants.ELEM_BODY, soapNamespace, "Content"); parts.add(encP); } else { - for (int i = 0; i < parts.size(); i++) { - WSEncryptionPart part = (WSEncryptionPart)parts.get(i); + for (WSEncryptionPart part : parts) { if ("STRTransform".equals(part.getName()) && part.getId() == null) { part.setId(strUri); } @@ -143,7 +142,8 @@ public class WSSecSignatureSAML extends parts.add(encP); } - List referenceList = addReferencesToSign(parts, secHeader); + List<javax.xml.crypto.dsig.Reference> referenceList = + addReferencesToSign(parts, secHeader); prependSAMLElementsToHeader(secHeader); @@ -217,7 +217,7 @@ public class WSSecSignatureSAML extends // thats if "senderVouches" is true. // SAMLSubjectStatement samlSubjS = null; - Iterator it = assertion.getStatements(); + Iterator<?> it = assertion.getStatements(); while (it.hasNext()) { SAMLObject so = (SAMLObject) it.next(); if (so instanceof SAMLSubjectStatement) { @@ -273,7 +273,7 @@ public class WSSecSignatureSAML extends try { XMLStructure keyInfoStructure = new DOMStructure(e); KeyInfo keyInfo = keyInfoFactory.unmarshalKeyInfo(keyInfoStructure); - List list = keyInfo.getContent(); + List<?> list = keyInfo.getContent(); for (int i = 0; i < list.size(); i++) { XMLStructure xmlStructure = (XMLStructure) list.get(i); @@ -281,7 +281,7 @@ public class WSSecSignatureSAML extends publicKey = ((KeyValue)xmlStructure).getPublicKey(); break; } else if (xmlStructure instanceof X509Data) { - List x509Data = ((X509Data)xmlStructure).getContent(); + List<?> x509Data = ((X509Data)xmlStructure).getContent(); for (int j = 0; j < x509Data.size(); j++) { Object x509obj = x509Data.get(j); if (x509obj instanceof X509Certificate) { @@ -342,7 +342,8 @@ public class WSSecSignatureSAML extends try { C14NMethodParameterSpec c14nSpec = null; if (wssConfig.isWsiBSPCompliant() && canonAlgo.equals(WSConstants.C14N_EXCL_OMIT_COMMENTS)) { - List prefixes = getInclusivePrefixes(secHeader.getSecurityHeader(), false); + List<String> prefixes = + getInclusivePrefixes(secHeader.getSecurityHeader(), false); c14nSpec = new ExcC14NParameterSpec(prefixes); } @@ -493,8 +494,11 @@ public class WSSecSignatureSAML extends * * @throws WSSecurityException */ - public void computeSignature(List referenceList, WSSecHeader secHeader, Element siblingElement) - throws WSSecurityException { + public void computeSignature( + List<javax.xml.crypto.dsig.Reference> referenceList, + WSSecHeader secHeader, + Element siblingElement + ) throws WSSecurityException { boolean remove = WSDocInfoStore.store(wsDocInfo); try { java.security.Key key; Modified: webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java?rev=1034482&r1=1034481&r2=1034482&view=diff ============================================================================== --- webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java (original) +++ webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java Fri Nov 12 17:29:54 2010 @@ -102,7 +102,7 @@ public class WSSecurityUtil { // // get all wsse:Security nodes // - List securityHeaderList = + List<Node> securityHeaderList = getDirectChildElements( soapHeaderElement, WSConstants.WSSE_LN, @@ -181,12 +181,12 @@ public class WSSecurityUtil { * @param namespace the namespace of the children to get * @return the list of nodes or <code>null</code> if not such nodes are found */ - public static List getDirectChildElements( + public static List<Node> getDirectChildElements( Node fNode, String localName, String namespace ) { - List children = new Vector(); + List<Node> children = new Vector<Node>(); for ( Node currentChild = fNode.getFirstChild(); currentChild != null; @@ -767,16 +767,16 @@ public class WSSecurityUtil { * @return The last result fetched from the result list, null if the result * could not be found */ - public static WSSecurityEngineResult fetchActionResult(List resultList, int action) { - + public static WSSecurityEngineResult fetchActionResult( + List<WSSecurityEngineResult> resultList, + int action + ) { WSSecurityEngineResult returnResult = null; - for (int i = 0; i < resultList.size(); i++) { + for (WSSecurityEngineResult result : resultList) { // // Check the result of every action whether it matches the given action // - WSSecurityEngineResult result = - (WSSecurityEngineResult) resultList.get(i); int resultAction = ((java.lang.Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue(); if (resultAction == action) { @@ -797,17 +797,15 @@ public class WSSecurityUtil { * @return The result fetched from the result list, null if the result * could not be found */ - public static List fetchAllActionResults( - List resultList, + public static List<WSSecurityEngineResult> fetchAllActionResults( + List<WSSecurityEngineResult> resultList, int action, - List actionResultList + List<WSSecurityEngineResult> actionResultList ) { - for (int i = 0; i < resultList.size(); i++) { + for (WSSecurityEngineResult result : resultList) { // // Check the result of every action whether it matches the given action // - WSSecurityEngineResult result = - (WSSecurityEngineResult) resultList.get(i); int resultAction = ((java.lang.Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue(); if (resultAction == action) { @@ -817,7 +815,10 @@ public class WSSecurityUtil { return actionResultList; } - public static int decodeAction(String action, List actions) throws WSSecurityException { + public static int decodeAction( + String action, + List<Integer> actions + ) throws WSSecurityException { int doAction = 0; if (action == null) { @@ -875,7 +876,7 @@ public class WSSecurityUtil { */ public static int decodeAction( String action, - List actions, + List<Integer> actions, WSSConfig wssConfig ) throws WSSecurityException { @@ -995,8 +996,9 @@ public class WSSecurityUtil { * @param action The action that is required (e.g. WSConstants.SIGN) * @param requiredParts An array of QNames that correspond to the required elements */ + @SuppressWarnings("unchecked") public static void checkAllElementsProtected( - List results, + List<WSSecurityEngineResult> results, int action, QName[] requiredParts ) throws WSSecurityException { @@ -1006,18 +1008,18 @@ public class WSSecurityUtil { QName requiredPart = requiredParts[i]; boolean found = false; - for (Iterator iter = results.iterator(); iter.hasNext() && !found;) { - WSSecurityEngineResult result = (WSSecurityEngineResult)iter.next(); + for (Iterator<WSSecurityEngineResult> iter = results.iterator(); + iter.hasNext() && !found;) { + WSSecurityEngineResult result = iter.next(); int resultAction = ((java.lang.Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue(); if (resultAction != action) { continue; } - java.util.List refList = - (java.util.List)result.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); + List<WSDataRef> refList = + (List<WSDataRef>)result.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); if (refList != null) { - for (int k = 0; k < refList.size(); k++) { - WSDataRef dataRef = (WSDataRef)refList.get(k); + for (WSDataRef dataRef : refList) { if (dataRef.getName().equals(requiredPart)) { found = true; break; @@ -1045,6 +1047,7 @@ public class WSSecurityUtil { * @param requiredIDs the list of wsu:Id values that must be covered * @throws WSSecurityException if any required element is not included */ + @SuppressWarnings("unchecked") public static void checkSignsAllElements( WSSecurityEngineResult resultItem, String[] requiredIDs @@ -1055,8 +1058,8 @@ public class WSSecurityUtil { throw new IllegalArgumentException("Not a SIGN result"); } - java.util.List signedElemsRefList = - (java.util.List)resultItem.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); + List<WSDataRef> signedElemsRefList = + (List<WSDataRef>)resultItem.get(WSSecurityEngineResult.TAG_DATA_REF_URIS); if (signedElemsRefList == null) { throw new WSSecurityException( "WSSecurityEngineResult does not contain any references to signed elements" @@ -1144,18 +1147,17 @@ public class WSSecurityUtil { /** * @return a list of child Nodes */ - public static java.util.List + public static List<Node> listChildren( final Node parent ) { - if (parent == null) { - return java.util.Collections.EMPTY_LIST; - } - final java.util.List ret = new java.util.Vector(); - Node node = parent.getFirstChild(); - while (node != null) { - ret.add(node); - node = node.getNextSibling(); + final List<Node> ret = new Vector<Node>(); + if (parent != null) { + Node node = parent.getFirstChild(); + while (node != null) { + ret.add(node); + node = node.getNextSibling(); + } } return ret; } @@ -1163,33 +1165,33 @@ public class WSSecurityUtil { /** * @return a list of Nodes in b that are not in a */ - public static java.util.List + public static List<Node> newNodes( - final java.util.List a, - final java.util.List b + final List<Node> a, + final List<Node> b ) { if (a.size() == 0) { return b; } + final List<Node> ret = new Vector<Node>(); if (b.size() == 0) { - return java.util.Collections.EMPTY_LIST; + return ret; } - final java.util.List ret = new java.util.Vector(); for ( - final java.util.Iterator bpos = b.iterator(); + final Iterator<Node> bpos = b.iterator(); bpos.hasNext(); ) { - final Node bnode = (Node) bpos.next(); - final java.lang.String bns = bnode.getNamespaceURI(); - final java.lang.String bln = bnode.getLocalName(); + final Node bnode = bpos.next(); + final String bns = bnode.getNamespaceURI(); + final String bln = bnode.getLocalName(); boolean found = false; for ( - final java.util.Iterator apos = a.iterator(); + final Iterator<Node> apos = a.iterator(); apos.hasNext() && !found; ) { - final Node anode = (Node) apos.next(); - final java.lang.String ans = anode.getNamespaceURI(); - final java.lang.String aln = anode.getLocalName(); + final Node anode = apos.next(); + final String ans = anode.getNamespaceURI(); + final String aln = anode.getLocalName(); final boolean nsmatch = ans == null ? ((bns == null) ? true : false) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
