Revision: 14609
          http://gate.svn.sourceforge.net/gate/?rev=14609&view=rev
Author:   valyt
Date:     2011-11-25 12:59:58 +0000 (Fri, 25 Nov 2011)
Log Message:
-----------
more NPE guards

Modified Paths:
--------------
    mimir/trunk/mimir-core/src/gate/mimir/search/query/AnnotationQuery.java
    mimir/trunk/mimir-core/src/gate/mimir/search/query/OrQuery.java

Modified: 
mimir/trunk/mimir-core/src/gate/mimir/search/query/AnnotationQuery.java
===================================================================
--- mimir/trunk/mimir-core/src/gate/mimir/search/query/AnnotationQuery.java     
2011-11-25 11:11:56 UTC (rev 14608)
+++ mimir/trunk/mimir-core/src/gate/mimir/search/query/AnnotationQuery.java     
2011-11-25 12:59:58 UTC (rev 14609)
@@ -135,7 +135,7 @@
      */
     public void close() throws IOException {
       super.close();
-      underlyingExecutor.close();
+      if(underlyingExecutor != null) underlyingExecutor.close();
     }
 
     /* (non-Javadoc)
@@ -158,7 +158,7 @@
      * @see gate.mimir.search.query.QueryExecutor#nextHit()
      */
     public Binding nextHit() throws IOException {
-      if(closed) return null;
+      if(closed || latestDocument == -1) return null;
       Binding underlyingHit = underlyingExecutor.nextHit();
       if(underlyingHit == null) return null;
       int doc = underlyingHit.getDocumentId();

Modified: mimir/trunk/mimir-core/src/gate/mimir/search/query/OrQuery.java
===================================================================
--- mimir/trunk/mimir-core/src/gate/mimir/search/query/OrQuery.java     
2011-11-25 11:11:56 UTC (rev 14608)
+++ mimir/trunk/mimir-core/src/gate/mimir/search/query/OrQuery.java     
2011-11-25 12:59:58 UTC (rev 14609)
@@ -101,7 +101,7 @@
      */
     public void close() throws IOException {
       super.close();
-      executors.close();
+      if(executors != null) executors.close();
       executors = null;
       hitsOnCurrentDocument.clear();
     }

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


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to