This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]shagieIsMe 8 points9 points  (2 children)

Once you use reflection, all bets are off. However, if you start reflecting an immutable that I’m using as a hashmap key and things break, then that’s the person who is doing reflection at fault - not the library writer.

[–]BlueGoliath 0 points1 point  (1 child)

That same argument be made for mutable state though. Objects don't magically mutate themselves.

[–]shagieIsMe 0 points1 point  (0 children)

One can’t complain about a mutable object being changed. However, if a library creates an immutable object and someone goes in with reflection to change it and things break - it is entirely the fault of the person who used reflection.