+2002-04-07 Mark Wielaard <mark@klomp.org>
+
+ * java/util/AbstractMap.java (putAll): Use entrySet size.
+ (toString): Explicitly use getKey() and getValue().
+
2002-04-07 Mark Wielaard <mark@klomp.org>
* java/util/Hashtable.java (contains): Remove NullPointer check.
public void putAll(Map m)
{
Iterator entries = m.entrySet().iterator();
- int pos = size();
+ int pos = m.size();
while (--pos >= 0)
{
Map.Entry entry = (Map.Entry) entries.next();
StringBuffer r = new StringBuffer("{");
for (int pos = size(); pos > 0; pos--)
{
- // Append the toString value of the entries rather than calling
- // getKey/getValue. This is more efficient and it matches the JDK
- // behaviour.
- r.append(entries.next());
+ Map.Entry entry = (Map.Entry) entries.next();
+ r.append(entry.getKey());
+ r.append('=');
+ r.append(entry.getValue());
if (pos > 1)
r.append(", ");
}