LUCENE-3484: Fix NPE in TaxonomyWriter: parents array creation was not thread safe.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1178923 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Doron Cohen 2011-10-04 19:30:05 +00:00
parent 2a73ef7e6c
commit e1560a8e81
2 changed files with 3 additions and 2 deletions

View File

@ -110,6 +110,8 @@ Bug Fixes
* LUCENE-3446: Fix NPE in BooleanFilter when DocIdSet/DocIdSetIterator is null.
Converted code to FixedBitSet and simplified. (Uwe Schindler, Shuji Umino)
* LUCENE-3484: Fix NPE in TaxonomyWriter: parents array creation was not thread safe.
API Changes
* LUCENE-3436: Add SuggestMode to the spellchecker, so you can specify the strategy

View File

@ -709,9 +709,8 @@ public class LuceneTaxonomyWriter implements TaxonomyWriter {
return true;
}
// TODO (Facet): synchronization of some sort?
private ParentArray parentArray;
private ParentArray getParentArray() throws IOException {
private synchronized ParentArray getParentArray() throws IOException {
if (parentArray==null) {
if (reader == null) {
reader = openReader();