@@ -280,21 +280,22 @@ public int getOrdinal(FacetLabel cp) throws IOException {
280280 }
281281
282282 // First try to find the answer in the LRU cache:
283+ Integer res ;
283284 synchronized (ordinalCache ) {
284- Integer res = ordinalCache .get (cp );
285- if ( res != null ) {
286- if (res < indexReader . maxDoc () ) {
287- // Since the cache is shared with DTR instances allocated from
288- // doOpenIfChanged, we need to ensure that the ordinal is one that
289- // this DTR instance recognizes.
290- return res ;
291- } else {
292- // if we get here, it means that the category was found in the cache,
293- // but is not recognized by this TR instance. Therefore, there's no
294- // need to continue search for the path on disk, because we won't find
295- // it there too.
296- return TaxonomyReader . INVALID_ORDINAL ;
297- }
285+ res = ordinalCache .get (cp );
286+ }
287+ if (res != null ) {
288+ if ( res < indexReader . maxDoc ()) {
289+ // Since the cache is shared with DTR instances allocated from
290+ // doOpenIfChanged, we need to ensure that the ordinal is one that
291+ // this DTR instance recognizes.
292+ return res ;
293+ } else {
294+ // if we get here, it means that the category was found in the cache,
295+ // but is not recognized by this TR instance. Therefore, there's no
296+ // need to continue search for the path on disk, because we won't find
297+ // it there too.
298+ return TaxonomyReader . INVALID_ORDINAL ;
298299 }
299300 }
300301
0 commit comments