lenamonj commented on PR #443: URL: https://github.com/apache/commons-codec/pull/443#issuecomment-5654869305
`getBytes(UTF_8)` turns a lone surrogate into `?`, so a name holding one shared its sort key with `?` and the `TreeSet` kept only one of them; `compareTo` now falls back to the `String` order when the bytes tie, which keeps both as the `String` comparator did, and never fires for well-formed names, whose UTF-8 encoding is unique; `testTreeIdKeepsNamesWithTheSameUtf8Bytes` covers it. Both Javadoc sentences are reworded. Two such names still serialize to the same byte, and `git hash-object -t tree -w` refuses that tree with `duplicateEntries`, so rejecting names UTF-8 cannot encode would stop `treeId` from hashing a tree git cannot store; that changes what it accepts, so it is not in this change unless you want it. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
