vdkoogh 2003/11/20 00:58:03
Modified: src/org/apache/xml/security/transforms/implementations
FuncHereContext.java TransformXPath2Filter04.java
TransformXPath.java TransformXSLT.java
TransformXPath2Filter.java
Log:
Organised imports, removed unneccessary casts and unused local variables and
private methods
CVS: ----------------------------------------------------------------------
CVS: PR:
CVS: If this change addresses a PR in the problem report tracking
CVS: database, then enter the PR number(s) here.
CVS: Obtained from:
CVS: If this change has been taken from another system, such as NCSA,
CVS: then name the system in this line, otherwise delete it.
CVS: Submitted by:
CVS: If this code has been contributed to Apache by someone else; i.e.,
CVS: they sent us a patch or a new module, then include their name/email
CVS: address here. If this is your work then delete this line.
CVS: Reviewed by:
CVS: If we are doing pre-commit code reviews and someone else has
CVS: reviewed your changes, include their name(s) here.
CVS: If you have not had it reviewed then delete this line.
Revision Changes Path
1.11 +4 -4
xml-security/src/org/apache/xml/security/transforms/implementations/FuncHereContext.java
Index: FuncHereContext.java
===================================================================
RCS file:
/home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/FuncHereContext.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FuncHereContext.java 11 Feb 2003 16:02:52 -0000 1.10
+++ FuncHereContext.java 20 Nov 2003 08:58:03 -0000 1.11
@@ -119,7 +119,7 @@
* @param owner
*/
public FuncHereContext(Node owner) {
- super((Object) owner);
+ super(owner);
}
/**
@@ -130,7 +130,7 @@
*/
public FuncHereContext(Node owner, XPathContext xpathContext) {
- super((Object) owner);
+ super(owner);
try {
super.m_dtmManager = xpathContext.getDTMManager();
@@ -149,7 +149,7 @@
*/
public FuncHereContext(Node owner, CachedXPathAPI previouslyUsed) {
- super((Object) owner);
+ super(owner);
try {
super.m_dtmManager =
previouslyUsed.getXPathContext().getDTMManager();
@@ -168,7 +168,7 @@
*/
public FuncHereContext(Node owner, DTMManager dtmManager) {
- super((Object) owner);
+ super(owner);
try {
super.m_dtmManager = dtmManager;
1.5 +1 -12
xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath2Filter04.java
Index: TransformXPath2Filter04.java
===================================================================
RCS file:
/home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath2Filter04.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TransformXPath2Filter04.java 29 Apr 2003 21:36:56 -0000 1.4
+++ TransformXPath2Filter04.java 20 Nov 2003 08:58:03 -0000 1.5
@@ -78,7 +78,6 @@
import org.apache.xml.security.transforms.Transforms;
import org.apache.xml.security.transforms.params.XPath2FilterContainer04;
import org.apache.xml.security.utils.CachedXPathFuncHereAPI;
-import org.apache.xml.security.utils.XMLUtils;
import org.apache.xpath.CachedXPathAPI;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
@@ -157,16 +156,6 @@
Object exArgs[] = { "dsig-xpath:XPath", "Transform" };
throw new TransformationException("xml.WrongContent", exArgs);
- }
-
- Document inputDoc = null;
-
- {
- Iterator it = inputSet.iterator();
-
- if (it.hasNext()) {
- inputDoc = XMLUtils.getOwnerDocument((Node) it.next());
- }
}
XPath2FilterContainer04 xpathContainer =
1.13 +0 -4
xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath.java
Index: TransformXPath.java
===================================================================
RCS file:
/home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- TransformXPath.java 29 Apr 2003 21:36:56 -0000 1.12
+++ TransformXPath.java 20 Nov 2003 08:58:03 -0000 1.13
@@ -78,7 +78,6 @@
import org.apache.xml.security.utils.CachedXPathFuncHereAPI;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.utils.PrefixResolverDefault;
-import org.apache.xpath.CachedXPathAPI;
import org.apache.xpath.objects.XObject;
import org.w3c.dom.DOMException;
import org.w3c.dom.Element;
@@ -148,9 +147,6 @@
Set inputSet = input.getNodeSet();
CachedXPathFuncHereAPI xPathFuncHereAPI =
new CachedXPathFuncHereAPI(input.getCachedXPathAPI());
- CachedXPathAPI myXPathAPI =
- new CachedXPathAPI(input.getCachedXPathAPI());
-
if (inputSet.size() == 0) {
Object exArgs[] = { "input node set contains no nodes" };
1.6 +1 -2
xml-security/src/org/apache/xml/security/transforms/implementations/TransformXSLT.java
Index: TransformXSLT.java
===================================================================
RCS file:
/home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/TransformXSLT.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- TransformXSLT.java 11 Feb 2003 16:02:52 -0000 1.5
+++ TransformXSLT.java 20 Nov 2003 08:58:03 -0000 1.6
@@ -85,7 +85,6 @@
import org.apache.xpath.XPathAPI;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
/**
@@ -172,7 +171,7 @@
{
ByteArrayOutputStream os = new ByteArrayOutputStream();
Transformer transformer = tFactory.newTransformer();
- DOMSource source = new DOMSource((Node) _xsltElement);
+ DOMSource source = new DOMSource(_xsltElement);
StreamResult result = new StreamResult(os);
transformer.transform(source, result);
1.9 +2 -47
xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath2Filter.java
Index: TransformXPath2Filter.java
===================================================================
RCS file:
/home/cvs/xml-security/src/org/apache/xml/security/transforms/implementations/TransformXPath2Filter.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- TransformXPath2Filter.java 29 Apr 2003 21:36:56 -0000 1.8
+++ TransformXPath2Filter.java 20 Nov 2003 08:58:03 -0000 1.9
@@ -80,8 +80,6 @@
import org.apache.xml.security.utils.CachedXPathFuncHereAPI;
import org.apache.xml.security.utils.HelperNodeList;
import org.apache.xml.security.utils.XMLUtils;
-import org.apache.xpath.CachedXPathAPI;
-import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -151,7 +149,6 @@
throws TransformationException {
try {
- long start = System.currentTimeMillis();
this._inputSet = input.getNodeSet();
@@ -163,8 +160,6 @@
CachedXPathFuncHereAPI xPathFuncHereAPI =
new CachedXPathFuncHereAPI(input.getCachedXPathAPI());
- CachedXPathAPI myXPathAPI =
- new CachedXPathAPI(input.getCachedXPathAPI());
Document inputDoc = null;
{
@@ -184,10 +179,6 @@
}
if (true) {
- XPath2FilterContainer unionDocFilter =
- XPath2FilterContainer
- .newInstanceUnion(this._transformObject.getDocument(),
"/");
-
_filterTypes.add(FUnion);
// Set root = new HashSet(); root.add(inputDoc);
@@ -244,8 +235,6 @@
result.setSourceURI(input.getSourceURI());
- long end = System.currentTimeMillis();
-
return result;
} catch (TransformerException ex) {
throw new TransformationException("empty", ex);
@@ -335,7 +324,7 @@
break;
} else {
- ;
+ //do nothing
}
}
@@ -385,40 +374,6 @@
if (ancestors.contains(rootNode)) {
return true;
- }
- }
-
- return false;
- }
-
- /**
- * Method __isRootedBy
- *
- * @param ctx
- * @param rootInQuestion
- *
- */
- private static boolean __isRootedBy(Node ctx, Node rootInQuestion) {
-
- if ((ctx == null) || (rootInQuestion == null)) {
- return false;
- }
-
- if (rootInQuestion.getNodeType() == Node.DOCUMENT_NODE) {
- return true;
- }
-
- Node n = ctx;
-
- while (n != null) {
- if (n == rootInQuestion) {
- return true;
- }
-
- if (n.getNodeType() == Node.ATTRIBUTE_NODE) {
- n = ((Attr) n).getOwnerElement();
- } else {
- n = n.getParentNode();
}
}