Update of /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12005/src/java/org/commonjava/opl
Modified Files:
NodeParser.java
Log Message:
corrected versioning differences...everything is up to date.
Index: NodeParser.java
===================================================================
RCS file: /cvsroot/commonjava/commonjava-projects/commonjava-opl/src/java/org/commonjava/opl/NodeParser.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- NodeParser.java 18 Feb 2004 06:12:10 -0000 1.14
+++ NodeParser.java 20 Feb 2004 21:16:03 -0000 1.15
@@ -3,6 +3,8 @@
*/
package org.commonjava.opl;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -10,6 +12,8 @@
import java.util.Properties;
import java.util.Set;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.commonjava.opl.generics.properties.PropertiesContainer;
import org.commonjava.util.LookupHelper;
import org.commonjava.util.Strings;
@@ -23,6 +27,8 @@
*/
public abstract class NodeParser {
+ private static final Log LOG = LogFactory.getLog(NodeParser.class);
+
private NodeParser parent;
private OPLContext context;
private ParserLibrary library;
@@ -407,6 +413,17 @@
*/
protected final Properties getAccumulatedProperties(){
buildMergedProperties();
+// JUST TOO VERBOSE, EVEN FOR DEBUGGING!
+// if (LOG.isDebugEnabled()) {
+// StringWriter sout = new StringWriter();
+// PrintWriter out = new PrintWriter(sout);
+// out.println("Merged Properties:");
+// mergedProperties.list(out);
+// out.println();
+// out.flush();
+//
+// LOG.debug(sout.getBuffer().toString());
+// }
return mergedProperties;
}
@@ -419,18 +436,29 @@
// will drag on and on...
// if(mergedProperties == null){
if(parent != null){
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Parent not null. Gathering accumulated properties from parent: " + getParent());
+ }
mergedProperties = parent.getAccumulatedProperties();
}
else{
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Parent is null. Using System Properties as the upstream accumulated properties.");
+ }
+
mergedProperties = new Properties(System.getProperties());
}
if(this instanceof PropertiesContainer){
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("I (" + getClass().getName() + ") am a PropertiesContainer. Retrieving my properties, and merging with upstream accumulated.");
+ }
Properties myProps = ((PropertiesContainer)this).getProperties();
if(myProps != null){
mergedProperties.putAll(myProps);
}
}
+
// }
}
}
|