Changeset 31686 for main/trunk


Ignore:
Timestamp:
05/18/17 10:39:22 (4 years ago)
Author:
kjdon
Message:

diego was sometimes getting arraylist outof bounds exception - we are getting an arraylist and then getting the first element without checking it at all. So added in a check for size > 0. not sure why its empty, is it a symptom of something else going wrong? don't have time to look at it now, and anyway, I want to rewrite query term highlighting one day.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java

    r31249 r31686  
    11931193            {
    11941194                ArrayList phrase_query_p_term_variants_list = phrase_query_term_variants_hierarchy.get(p);
     1195                if (phrase_query_p_term_variants_list.size()>0) {
    11951196                HashSet phrase_query_p_term_1_variants = (HashSet) phrase_query_p_term_variants_list.get(0);
    11961197                if (phrase_query_p_term_1_variants.contains(word_match.word))
     
    12081209                    }
    12091210                }
     1211                }
    12101212            }
    12111213        }
Note: See TracChangeset for help on using the changeset viewer.