From: mike Date: Wed, 20 Nov 2002 17:26:42 +0000 (+0000) Subject: Fix a silly bug, recently introduced, which prevented prox modifiers X-Git-Tag: v1.5~199 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=8a7980aa0d3ea84b199dce9daca42e6286efaa2a;p=cql-java-moved-to-github.git Fix a silly bug, recently introduced, which prevented prox modifiers from being properly emitted as XCQL. I'd wrongly added the new argument, Vector prefixes, to CQLProxNode.opXCQL(), so that its type signature was different from that of CQLBooleanNode.opXCQL() and it didn't override the base class's functionality. Also, fix a minor typo: renamed opXQL() to opCXQL(), which is what I intended all along. Just a slip of the finger. --- diff --git a/src/org/z3950/zing/cql/CQLBooleanNode.java b/src/org/z3950/zing/cql/CQLBooleanNode.java index 56fdde2..9679ec4 100644 --- a/src/org/z3950/zing/cql/CQLBooleanNode.java +++ b/src/org/z3950/zing/cql/CQLBooleanNode.java @@ -1,4 +1,4 @@ -// $Id: CQLBooleanNode.java,v 1.9 2002-11-20 01:15:14 mike Exp $ +// $Id: CQLBooleanNode.java,v 1.10 2002-11-20 17:26:42 mike Exp $ package org.z3950.zing.cql; import java.util.Properties; @@ -8,7 +8,7 @@ import java.util.Vector; /** * Represents a boolean node in a CQL parse-tree. * - * @version $Id: CQLBooleanNode.java,v 1.9 2002-11-20 01:15:14 mike Exp $ + * @version $Id: CQLBooleanNode.java,v 1.10 2002-11-20 17:26:42 mike Exp $ */ public abstract class CQLBooleanNode extends CQLNode { CQLBooleanNode() {} // prevent javadoc from documenting this @@ -26,7 +26,7 @@ public abstract class CQLBooleanNode extends CQLNode { public String toXCQL(int level, Vector prefixes) { return (indent(level) + "\n" + renderPrefixes(level+1, prefixes) + - opXQL(level+1) + + opXCQL(level+1) + indent(level+1) + "\n" + left.toXCQL(level+2, new Vector()) + indent(level+1) + "\n" + @@ -37,7 +37,8 @@ public abstract class CQLBooleanNode extends CQLNode { } // Represents the boolean operation itself: overridden for CQLProxNode - String opXQL(int level) { + String opXCQL(int level) { + System.err.println("in CQLBooleanNode.opXCQL()"); return(indent(level) + "\n" + indent(level+1) + "" + op() + "\n" + indent(level) + "\n"); diff --git a/src/org/z3950/zing/cql/CQLProxNode.java b/src/org/z3950/zing/cql/CQLProxNode.java index e31bd2c..23f3fbc 100644 --- a/src/org/z3950/zing/cql/CQLProxNode.java +++ b/src/org/z3950/zing/cql/CQLProxNode.java @@ -1,4 +1,4 @@ -// $Id: CQLProxNode.java,v 1.4 2002-11-20 01:15:15 mike Exp $ +// $Id: CQLProxNode.java,v 1.5 2002-11-20 17:26:42 mike Exp $ package org.z3950.zing.cql; import java.util.Vector; @@ -10,7 +10,7 @@ import java.util.Vector; * candidate records which are sufficiently close to each other, as * specified by a set of proximity parameters. * - * @version $Id: CQLProxNode.java,v 1.4 2002-11-20 01:15:15 mike Exp $ + * @version $Id: CQLProxNode.java,v 1.5 2002-11-20 17:26:42 mike Exp $ */ public class CQLProxNode extends CQLBooleanNode { ModifierSet ms; @@ -71,7 +71,8 @@ public class CQLProxNode extends CQLBooleanNode { return ms.toCQL(); } - String opXQL(int level, Vector prefixes) { + String opXCQL(int level) { + System.err.println("in CQLProxNode.opXCQL()"); return ms.toXCQL(level, "boolean"); } diff --git a/src/org/z3950/zing/cql/ModifierSet.java b/src/org/z3950/zing/cql/ModifierSet.java index c88a694..deaab3b 100644 --- a/src/org/z3950/zing/cql/ModifierSet.java +++ b/src/org/z3950/zing/cql/ModifierSet.java @@ -1,4 +1,4 @@ -// $Id: ModifierSet.java,v 1.5 2002-11-17 23:29:02 mike Exp $ +// $Id: ModifierSet.java,v 1.6 2002-11-20 17:26:42 mike Exp $ package org.z3950.zing.cql; import java.util.Vector; @@ -15,7 +15,7 @@ import java.lang.StringBuffer; * zero or more type=value pairs, where both type and * value are strings. Types may be null, values may not. * - * @version $Id: ModifierSet.java,v 1.5 2002-11-17 23:29:02 mike Exp $ + * @version $Id: ModifierSet.java,v 1.6 2002-11-20 17:26:42 mike Exp $ */ public class ModifierSet { String base; @@ -79,6 +79,7 @@ public class ModifierSet { } public String toXCQL(int level, String topLevelElement) { + System.err.println("in ModifierSet.toXCQL()"); StringBuffer buf = new StringBuffer(); buf.append (Utils.indent(level) + "<" + topLevelElement + ">\n" + Utils.indent(level+1) + "" + Utils.xq(base) +