Closed greenlaw110 closed 6 years ago
Okay, so this design is made in purpose actually. Think about if a target Map is an immutable map, then we can't put anything inside it. As the type is declared as Map, we assume it is safe to replace the implementation type to HashMap. However this make it a bit loose when target type is things like LinkedHashMap, the replacement actually changes the behavior to some extend.
The fix will take care of the LinkedHashMap, LinkedHashSet case now.
Found on osgl-tool-1.14.0
Test code:
Running test1 will show error
java.lang.AssertionError: It shall not change bar.map instance