Revision: 7227
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=7227&view=rev
Author:   dnaber
Date:     2012-06-03 21:09:07 +0000 (Sun, 03 Jun 2012)
Log Message:
-----------
check for null query

Modified Paths:
--------------
    trunk/JLanguageTool/src/dev/org/languagetool/dev/index/Searcher.java

Modified: trunk/JLanguageTool/src/dev/org/languagetool/dev/index/Searcher.java
===================================================================
--- trunk/JLanguageTool/src/dev/org/languagetool/dev/index/Searcher.java        
2012-06-03 20:57:55 UTC (rev 7226)
+++ trunk/JLanguageTool/src/dev/org/languagetool/dev/index/Searcher.java        
2012-06-03 21:09:07 UTC (rev 7227)
@@ -72,6 +72,9 @@
   public SearcherResult findRuleMatchesOnIndex(PatternRule rule, Language 
language, IndexSearcher indexSearcher) throws IOException {
     final PossiblyRelaxedQuery query = createQuery(rule);
     final Sort sort = new Sort(new SortField("docCount", SortField.INT));  // 
do not sort by relevance as this will move the shortest documents to the top
+    if (query.query == null) {
+      throw new NullPointerException("Cannot search on null query for rule: " 
+ rule);
+    }
     final TopDocs topDocs = indexSearcher.search(query.query, maxHits, sort);
     final JLanguageTool languageTool = getLanguageToolWithOneRule(language, 
rule);
     final List<MatchingSentence> matchingSentences = 
findMatchingSentences(indexSearcher, topDocs, languageTool);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs

Reply via email to