Re:Java 21 makes me like Java again
by thangalin on Sunday September 17, 2023 @01:50PM
(#37547640)
A set is a collection of objects in which order has no significance, and multiplicity is generally also ignored. Observing the code alone, it isn't obvious that two FileInfo instances having the same path are themselves not equal. As has been mentioned elsewhere, FileInfo should not be hashable to prevent declaring it as a Set, avoiding the situation entirely.
C# isn't flawless. Java isn't flawless.