076e6a36cc
FindBugs says: Adding elements of an entry set may fail due to reuse of Map.Entry object. The entrySet() method is allowed to return a view of the underlying Map in which a single Entry object is reused and returned during the iteration. As of Java 1.6, both IdentityHashMap and EnumMap did so. When iterating through such a Map, the Entry value is only valid until you advance to the next iteration. If, for example, you try to pass such an entrySet to an addAll method, things will go badly wrong. Instead of using addAll, explicitly add each entry by iterating over the map. Change-Id: I0468060f67c63c877469ec565eb594b960c52c89