vgritsenko 2004/01/12 17:48:24
Modified: java/src/org/apache/xindice/xml/dom NodeImpl.java
java/src/org/apache/xindice/core/query
XPathQueryResolver.java
Log:
Remove unnecessary field initializers
Revision Changes Path
1.12 +18 -18
xml-xindice/java/src/org/apache/xindice/xml/dom/NodeImpl.java
Index: NodeImpl.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/NodeImpl.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- NodeImpl.java 9 Aug 2003 21:19:52 -0000 1.11
+++ NodeImpl.java 13 Jan 2004 01:48:23 -0000 1.12
@@ -124,25 +124,25 @@
new DOMException(DOMException.INDEX_SIZE_ERR, "Index Out Of
Bounds");
// Serialization Stuff
- protected NodeSource source = null;
- protected byte[] data = null;
- protected int pos = 0;
- protected int len = 0;
+ protected NodeSource source;
+ protected byte[] data;
+ protected int pos;
+ protected int len;
- protected boolean loaded = false; // Have the definitions for this node
been loaded?
- protected boolean dirty = false; // Has this node been modified?
+ protected boolean loaded; // Have the definitions for this node been
loaded?
+ protected boolean dirty; // Has this node been modified?
// DOM Level 1 Stuff
- protected NodeImpl parentNode = null;
- protected String nodeName = null;
- protected String nodeValue = null;
+ protected NodeImpl parentNode;
+ protected String nodeName;
+ protected String nodeValue;
// DOM Level 2 Stuff
- protected String nsURI = null; // Just for caching so we don't have
to walk the tree
+ protected String nsURI; // Just for caching so we don't have to walk
the tree
// DOM Level 3 Stuff
- protected HashMap userData = null;
- protected Object key = null;
+ protected HashMap userData;
+ protected Object key;
public NodeImpl() {
}
@@ -330,7 +330,7 @@
if (getNodeType() == Node.DOCUMENT_NODE) {
return (Document) this;
}
-
+
return parentNode != null ? parentNode.getOwnerDocument()
: null;
}
@@ -621,7 +621,7 @@
case Node.TEXT_NODE:
return doc.createTextNode(nodeValue);
-
+
default:
if (log.isWarnEnabled()) {
log.warn("invalid node type : " + getNodeType());
@@ -818,7 +818,7 @@
if (uri != null && uri.length() > 0) {
return uri;
}
-
+
return parentNode != null ? parentNode.lookupDefaultNamespaceURI()
: null;
}
@@ -878,7 +878,7 @@
if (uri != null && uri.length() > 0) {
return uri;
}
-
+
return parentNode != null ? parentNode.lookupNamespaceURI(prefix)
: null;
}
1.26 +7 -13
xml-xindice/java/src/org/apache/xindice/core/query/XPathQueryResolver.java
Index: XPathQueryResolver.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/query/XPathQueryResolver.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- XPathQueryResolver.java 22 Dec 2003 01:35:10 -0000 1.25
+++ XPathQueryResolver.java 13 Jan 2004 01:48:23 -0000 1.26
@@ -1448,11 +1448,9 @@
{
node = null;
- while (keyPos < keySet.length)
- {
+ while (keyPos < keySet.length) {
DBDocument d = (DBDocument)
context.getDocument(keySet[keyPos++]);
- if (d == null)
- {
+ if (d == null) {
continue;
}
@@ -1460,16 +1458,12 @@
XPathContext xpc = new XPathContext();
PrefixResolver pfx;
- if (pr == null)
- {
+ if (pr == null) {
pfx = new
PrefixResolverDefault(d.getDocumentElement());
xp = new XPath(query, null, pfx,
XPath.SELECT, errors);
- }
- else
- {
+ } else {
pfx = pr;
- if (xp == null)
- {
+ if (xp == null) {
xp = new XPath(query, null,
pfx, XPath.SELECT, errors);
}
}