aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/util/AbstractMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/util/AbstractMap.java')
-rw-r--r--libjava/java/util/AbstractMap.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/libjava/java/util/AbstractMap.java b/libjava/java/util/AbstractMap.java
index 393d3c7754d..555d055394d 100644
--- a/libjava/java/util/AbstractMap.java
+++ b/libjava/java/util/AbstractMap.java
@@ -353,7 +353,7 @@ public abstract class AbstractMap implements Map
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();
@@ -425,10 +425,10 @@ public abstract class AbstractMap implements Map
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(", ");
}