reject non-canonical UUID strings in UUIDConverter#409
Conversation
|
Hello @rootvector2 One could argue that Where did you get the requirement that the String form of a UUID or a Converter output in general must roundtrip with its String inout? Maybe I missed it. I've updated the Javadoc which might give readers better expectations. |
|
Fair enough. I was treating a canonical round-trip as an implicit expectation, but you're right that there's no spec backing it and the converter should mirror |
|
Closing per the discussion above. |
UUID.fromStringaccepts abbreviated groups like1-1-1-1-1and silently canonicalizes them to00000001-0001-0001-0001-000000000001, soUUIDConverterconverts strings that are not the canonical 8-4-4-4-12 form; found while auditing the converters that delegate straight to a lenient JDK parse, and fixed by rejecting any input that does not round-trip to its canonical string (upper case still converts).mvn; that'smvnon the command line by itself.