From 0cf2302a18eacaa327f40743c4ac59cf6c630183 Mon Sep 17 00:00:00 2001 From: mike Date: Tue, 3 Jul 2007 16:40:41 +0000 Subject: [PATCH] Fail a sortspec of zero keys. --- src/org/z3950/zing/cql/CQLParser.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } -- 1.7.10.4