added synchronization to prevent threads from seeing inconsistent name / number mappings when asserting for consistency

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1087427 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2011-03-31 19:59:15 +00:00
parent 937ee38c7f
commit 004524dbec
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ public final class FieldInfos implements Iterable<FieldInfo> {
}
// used by assert
boolean containsConsistent(Integer number, String name) {
synchronized boolean containsConsistent(Integer number, String name) {
return name.equals(numberToName.get(number))
&& number.equals(nameToNumber.get(name));
}