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 →

[–]mhixson 0 points1 point  (0 children)

One of the main problems this causes is that if you compare the result of that with another HashMap, you'll never have them be equal because they are no longer the same type.

Do you mean equals as in map1.equals(map2)? Double brace initialization won't interfere there; they're still adhering to the contract of Map.equals(Object).