diff --git a/src/java/org/apache/lucene/queryParser/QueryParser.java b/src/java/org/apache/lucene/queryParser/QueryParser.java index f734450e351..35f8e39c953 100644 --- a/src/java/org/apache/lucene/queryParser/QueryParser.java +++ b/src/java/org/apache/lucene/queryParser/QueryParser.java @@ -238,6 +238,13 @@ public class QueryParser implements QueryParserConstants { break; v.addElement(t.termText()); } + try { + source.close(); + } + catch (IOException e) { + // ignore + } + if (v.size() == 0) return null; else if (v.size() == 1) diff --git a/src/java/org/apache/lucene/queryParser/QueryParser.jj b/src/java/org/apache/lucene/queryParser/QueryParser.jj index 2320e8dfb2e..02ea937f3f2 100644 --- a/src/java/org/apache/lucene/queryParser/QueryParser.jj +++ b/src/java/org/apache/lucene/queryParser/QueryParser.jj @@ -300,6 +300,13 @@ public class QueryParser { break; v.addElement(t.termText()); } + try { + source.close(); + } + catch (IOException e) { + // ignore + } + if (v.size() == 0) return null; else if (v.size() == 1)