jpountz commented on code in PR #13460: URL: https://github.com/apache/lucene/pull/13460#discussion_r1629497818
########## lucene/core/src/java/org/apache/lucene/index/FieldInfos.java: ########## @@ -664,14 +643,13 @@ synchronized void verifyOrCreateDvOnlyField( * {@code dvType} returns a new FieldInfo based based on the options in global field numbers */ FieldInfo constructFieldInfo(String fieldName, DocValuesType dvType, int newFieldNumber) { - Integer fieldNumber; + FieldProperties fieldProperties; synchronized (this) { - fieldNumber = nameToNumber.get(fieldName); + fieldProperties = this.fieldProperties.get(fieldName); Review Comment: This entire class is shared by the IndexWriter so access needs to be protected. The fact that access to `docValuesType` was not protected is more surprising to me, it seems to rely on subtle happens-before guarantees? Anyway, I like that your change is simplifying this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org