You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/11/03 11:14:34 UTC

[GitHub] [lucene] thecoop commented on a diff in pull request #11847: Add a method allowing canonical strings to be returned from DataInput

thecoop commented on code in PR #11847:
URL: https://github.com/apache/lucene/pull/11847#discussion_r1012767732


##########
lucene/core/src/java/org/apache/lucene/store/DataInput.java:
##########
@@ -280,6 +281,18 @@ public String readString() throws IOException {
     return new String(bytes, 0, length, StandardCharsets.UTF_8);
   }
 
+  private final Map<String, String> canonicalStrings = new HashMap<>();

Review Comment:
   Added code to handle cloning. Seeing as the variable is no longer final, I've also made it lazily initialised.



-- 
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-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org