diff --git a/lucene/src/test/org/apache/lucene/TestExternalCodecs.java b/lucene/src/test/org/apache/lucene/TestExternalCodecs.java index e6390b154ed..298f7b7729f 100644 --- a/lucene/src/test/org/apache/lucene/TestExternalCodecs.java +++ b/lucene/src/test/org/apache/lucene/TestExternalCodecs.java @@ -484,7 +484,9 @@ public class TestExternalCodecs extends LuceneTestCase { public FieldsProducer fieldsProducer(SegmentReadState readState) throws IOException { - return state.get(readState.segmentInfo.name); + synchronized(state) { + return state.get(readState.segmentInfo.name); + } } @Override