/[classpath]/classpath/java/util/AbstractMap.java
ViewVC logotype

Diff of /classpath/java/util/AbstractMap.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by ericb, Wed Feb 20 23:56:46 2002 UTC revision 1.22 by mark, Mon Apr 8 00:20:00 2002 UTC
# Line 353  public abstract class AbstractMap implem Line 353  public abstract class AbstractMap implem
353    public void putAll(Map m)    public void putAll(Map m)
354    {    {
355      Iterator entries = m.entrySet().iterator();      Iterator entries = m.entrySet().iterator();
356      int pos = size();      int pos = m.size();
357      while (--pos >= 0)      while (--pos >= 0)
358        {        {
359          Map.Entry entry = (Map.Entry) entries.next();          Map.Entry entry = (Map.Entry) entries.next();
# Line 425  public abstract class AbstractMap implem Line 425  public abstract class AbstractMap implem
425      StringBuffer r = new StringBuffer("{");      StringBuffer r = new StringBuffer("{");
426      for (int pos = size(); pos > 0; pos--)      for (int pos = size(); pos > 0; pos--)
427        {        {
428          // Append the toString value of the entries rather than calling          Map.Entry entry = (Map.Entry) entries.next();
429          // getKey/getValue. This is more efficient and it matches the JDK          r.append(entry.getKey());
430          // behaviour.          r.append('=');
431          r.append(entries.next());          r.append(entry.getValue());
432          if (pos > 1)          if (pos > 1)
433            r.append(", ");            r.append(", ");
434        }        }

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26