From: mike Date: Tue, 3 Jul 2007 16:40:41 +0000 (+0000) Subject: Fail a sortspec of zero keys. X-Git-Tag: v1.5~48 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=0cf2302a18eacaa327f40743c4ac59cf6c630183;p=cql-java-moved-to-github.git Fail a sortspec of zero keys. --- diff --git a/src/org/z3950/zing/cql/CQLParser.java b/src/org/z3950/zing/cql/CQLParser.java index f622bbb..9ccb139 100644 --- a/src/org/z3950/zing/cql/CQLParser.java +++ b/src/org/z3950/zing/cql/CQLParser.java @@ -1,4 +1,4 @@ -// $Id: CQLParser.java,v 1.37 2007-07-03 13:34:30 mike Exp $ +// $Id: CQLParser.java,v 1.38 2007-07-03 16:40:41 mike Exp $ package org.z3950.zing.cql; import java.io.IOException; @@ -12,7 +12,7 @@ import java.io.FileNotFoundException; /** * Compiles CQL strings into parse trees of CQLNode subtypes. * - * @version $Id: CQLParser.java,v 1.37 2007-07-03 13:34:30 mike Exp $ + * @version $Id: CQLParser.java,v 1.38 2007-07-03 16:40:41 mike Exp $ * @see http://zing.z3950.org/cql/index.html */ @@ -105,6 +105,11 @@ public class CQLParser { ModifierSet ms = gatherModifiers(sortindex); sortnode.addSortIndex(ms); } + + if (sortnode.keys.size() == 0) { + throw new CQLParseException("no sort keys"); + } + node = sortnode; }