Skip to content

Commit cea1c27

Browse files
author
sebastigurin
committed
when invoking constructor java.util.HashMap.HashMap(Map<? extends K, ? extends V>) a javascript error "putAll method not defined" was thrown. related bug artifact: https://sourceforge.net/tracker/?func=detail&aid=2841931&group_id=155436&atid=795800.
This fixes Hashmap problem, but should be nice to investigate why fails when putAll is called like the original code does. Left original code commented because of this.
1 parent 294c02f commit cea1c27

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

sources/net.sf.j2s.java.core/src/java/util/HashMap.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,12 @@ public HashMap(int capacity, float loadFactor) {
268268
* the mappings to add
269269
*/
270270
public HashMap(Map<? extends K, ? extends V> map) {
271-
this(map.size() < 6 ? 11 : map.size() * 2);
272-
super.putAll(map);
271+
//sgurin fix: the original code was giving a javascript error putAll() method doens't exists. This at least works, but should be nice to investigate why fails ehwn putAll is called like the original code does.
272+
this();
273+
putAll(map);
274+
//sgurin : original code:
275+
// this(map.size() < 6 ? 11 : map.size() * 2);
276+
// super.putAll(map);
273277
}
274278

275279
/**

0 commit comments

Comments
 (0)