--- old\MemValueIndexer.java Wed Feb 16 13:59:49 2005 UTC +++ new\MemValueIndexer.java Mon Nov 07 12:58:35 2005 UTC @@ -87,6 +87,8 @@ private static final String CHAR_VAL = "char"; private static final String BOOLEAN_VAL = "boolean"; + private final static IndexMatch[] EMPTY_INDEX_MATCH_ARRAY = new IndexMatch[0]; + // // Instance variables // @@ -321,7 +323,7 @@ // see whether or not we even have the value to be excluded TreeSet anExcludedLocatorSet = (TreeSet) itsValues.get(aLowEndpoint); - aValueIterator = itsValues.values().iterator(); + aValueIterator = itsValues.entrySet().iterator(); int aResultIndex = 0; if (anExcludedLocatorSet == null) { // allocate return array to include all locators since none are excluded @@ -485,7 +487,7 @@ break; } - return aResult; + return aResult == null ? EMPTY_INDEX_MATCH_ARRAY : aResult; } /** @@ -662,7 +664,7 @@ Iterator aValueIterator; int aLocatorCount = 0; - aValueIterator = theMap.values().iterator(); + aValueIterator = theMap.entrySet().iterator(); // iterate over the values adding locators for each matched to result while (aValueIterator.hasNext()) { @@ -723,7 +725,7 @@ // qualify the results for filter operation // adding those qualifying to aResultCollection and counting filtered results - aValueIterator = theFirstMap.values().iterator(); + aValueIterator = theFirstMap.entrySet().iterator(); // iterate over the values adding locators for each matched to result while (aValueIterator.hasNext()) { @@ -1095,7 +1097,7 @@ int aCount = 0; if (theMap != null) { - Iterator aValueIterator = theMap.values().iterator(); + Iterator aValueIterator = theMap.entrySet().iterator(); // iterate over the values adding locators for each to result // no need to filter while iterating while (aValueIterator.hasNext()) { @@ -1120,7 +1122,7 @@ return theStartIndex; } - Iterator aValueIterator = theMap.values().iterator(); + Iterator aValueIterator = theMap.entrySet().iterator(); // iterate over the values adding locators for each to result // no need to filter while iterating while (aValueIterator.hasNext()) {