From 56ff0c11c2ba47db7fb83ebed7141ccb6776fd73 Mon Sep 17 00:00:00 2001 From: Shai Erera Date: Wed, 22 Sep 2010 15:14:20 +0000 Subject: [PATCH] FileBasedQueryMaker could add a null Query if the query failed to parse git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1000030 13f79535-47bb-0310-9956-ffa450edef68 --- .../benchmark/byTask/feeds/FileBasedQueryMaker.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/FileBasedQueryMaker.java b/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/FileBasedQueryMaker.java index 4b7186a26fb..dbfc73196c4 100644 --- a/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/FileBasedQueryMaker.java +++ b/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/FileBasedQueryMaker.java @@ -73,18 +73,14 @@ public class FileBasedQueryMaker extends AbstractQueryMaker implements QueryMake BufferedReader buffered = new BufferedReader(reader); String line = null; int lineNum = 0; - while ((line = buffered.readLine()) != null) - { + while ((line = buffered.readLine()) != null) { line = line.trim(); - if (!line.equals("") && !line.startsWith("#")) - { - Query query = null; + if (line.length() != 0 && !line.startsWith("#")) { try { - query = qp.parse(line); + qq.add(qp.parse(line)); } catch (ParseException e) { System.err.println("Exception: " + e.getMessage() + " occurred while parsing line: " + lineNum + " Text: " + line); } - qq.add(query); } lineNum++; }