You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by mu...@apache.org on 2006/06/02 21:49:14 UTC

svn commit: r411273 - /xml/security/trunk/src/org/apache/xml/security/transforms/implementations/TransformXPath.java

Author: mullan
Date: Fri Jun  2 12:49:14 2006
New Revision: 411273

URL: http://svn.apache.org/viewvc?rev=411273&view=rev
Log:
Fix findbugs bug:
Unread field: TransformXPath.log
XPathNodeFilter should be a static inner class.

Modified:
    xml/security/trunk/src/org/apache/xml/security/transforms/implementations/TransformXPath.java

Modified: xml/security/trunk/src/org/apache/xml/security/transforms/implementations/TransformXPath.java
URL: http://svn.apache.org/viewvc/xml/security/trunk/src/org/apache/xml/security/transforms/implementations/TransformXPath.java?rev=411273&r1=411272&r2=411273&view=diff
==============================================================================
--- xml/security/trunk/src/org/apache/xml/security/transforms/implementations/TransformXPath.java (original)
+++ xml/security/trunk/src/org/apache/xml/security/transforms/implementations/TransformXPath.java Fri Jun  2 12:49:14 2006
@@ -16,8 +16,6 @@
  */
 package org.apache.xml.security.transforms.implementations;
 
-
-
 import javax.xml.transform.TransformerException;
 
 import org.apache.xml.security.exceptions.XMLSecurityRuntimeException;
@@ -36,7 +34,6 @@
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
-
 /**
  * Class TransformXPath
  *
@@ -49,15 +46,10 @@
  */
 public class TransformXPath extends TransformSpi {
 
-   /** {@link org.apache.commons.logging} logging facility */
-    static org.apache.commons.logging.Log log = 
-        org.apache.commons.logging.LogFactory.getLog(TransformXPath.class.getName());
-
    /** Field implementedTransformURI */
    public static final String implementedTransformURI =
       Transforms.TRANSFORM_XPATH;
 
-
    /**
     * Method engineGetURI
     *
@@ -127,40 +119,39 @@
     private boolean needsCircunvent(String str) {
     	return true;
     	//return str.contains("namespace");
-    	
     }
-    class XPathNodeFilter implements NodeFilter {
-    	 PrefixResolverDefault prefixResolver;
-    	 CachedXPathFuncHereAPI xPathFuncHereAPI =
-             new CachedXPathFuncHereAPI(CachedXPathAPIHolder.getCachedXPathAPI());
-          ;
-    	Node xpathnode; 
+
+    static class XPathNodeFilter implements NodeFilter {
+    	PrefixResolverDefault prefixResolver;
+    	CachedXPathFuncHereAPI xPathFuncHereAPI =
+            new CachedXPathFuncHereAPI(CachedXPathAPIHolder.getCachedXPathAPI());
+	Node xpathnode; 
     	String str;
     	XPathNodeFilter(Element xpathElement,
     			Node xpathnode, String str) {
-    		this.xpathnode=xpathnode;
-    		this.str=str;
-    		prefixResolver =new PrefixResolverDefault(xpathElement);
+    	    this.xpathnode=xpathnode;
+    	    this.str=str;
+    	    prefixResolver =new PrefixResolverDefault(xpathElement);
     	}
-    	    
 
-		/**
-		 * @see org.apache.xml.security.signature.NodeFilter#isNodeInclude(org.w3c.dom.Node)
-		 */
-		public boolean isNodeInclude(Node currentNode) {			
-			XObject includeInResult;
-			try {
-				includeInResult = xPathFuncHereAPI.eval(currentNode,
-				        xpathnode, str,prefixResolver);
-				return includeInResult.bool();
-			} catch (TransformerException e) {
+	/**
+	 * @see org.apache.xml.security.signature.NodeFilter#isNodeInclude(org.w3c.dom.Node)
+	 */
+	public boolean isNodeInclude(Node currentNode) {			
+	    XObject includeInResult;
+	    try {
+		includeInResult = xPathFuncHereAPI.eval(currentNode,
+			        xpathnode, str,prefixResolver);
+		return includeInResult.bool();
+	    } catch (TransformerException e) {
                 Object[] eArgs = {currentNode};
-				throw new XMLSecurityRuntimeException("signature.Transform.node", eArgs, e);
-			}	
-			catch (Exception e) {
+	        throw new XMLSecurityRuntimeException
+		    ("signature.Transform.node", eArgs, e);
+	    } catch (Exception e) {
                 Object[] eArgs = {currentNode, new Short(currentNode.getNodeType())};
-				throw new XMLSecurityRuntimeException("signature.Transform.nodeAndType",eArgs, e);
-			}
-		}
+		throw new XMLSecurityRuntimeException
+		    ("signature.Transform.nodeAndType",eArgs, e);
+	    }
+	}
     }
 }