Revision: 19444
          http://sourceforge.net/p/gate/code/19444
Author:   ian_roberts
Date:     2016-06-28 16:38:18 +0000 (Tue, 28 Jun 2016)
Log Message:
-----------
NPE guard for the situation where you want to combine result sets from a 
federated index, and some of the underlying term descriptions are not present 
in every sub-index.

Modified Paths:
--------------
    mimir/trunk/mimir-core/src/gate/mimir/search/terms/TermsResultSet.java

Modified: mimir/trunk/mimir-core/src/gate/mimir/search/terms/TermsResultSet.java
===================================================================
--- mimir/trunk/mimir-core/src/gate/mimir/search/terms/TermsResultSet.java      
2016-06-28 12:42:13 UTC (rev 19443)
+++ mimir/trunk/mimir-core/src/gate/mimir/search/terms/TermsResultSet.java      
2016-06-28 16:38:18 UTC (rev 19444)
@@ -296,7 +296,7 @@
         // we use the term position instead
         // newStrings[pos] = Integer.toString(pos);
         Set<String> uniq = new HashSet<String>();
-        for(String[] terms : tData.getStrings()) {
+        for(String[] terms : originalTermStrings[pos]) {
           for(String term : terms) {
             uniq.add(term);
           }
@@ -370,7 +370,11 @@
     public String[][] getStrings() {
       String[][] res = new String[strings.length][];
       for(int i = 0; i < strings.length; i++) {
-        res[i] = strings[i].toArray(new String[strings[i].size()]);
+        if(strings[i] == null) {
+          res[i] = new String[0];
+        } else {
+          res[i] = strings[i].toArray(new String[strings[i].size()]);
+        }
       }
       return res;
     }

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


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to