ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/AbstractMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/AbstractMap.java (file contents):
Revision 1.10 by jsr166, Mon May 16 05:03:18 2005 UTC vs.
Revision 1.12 by jsr166, Fri Jun 10 16:06:46 2005 UTC

# Line 468 | Line 468 | public abstract class AbstractMap<K,V> i
468       * appended.  Finally a right brace is appended.  A string is obtained
469       * from the stringbuffer, and returned.
470       *
471 <     * @return a String representation of this map.
471 >     * @return a String representation of this map
472       */
473      public String toString() {
474 <        StringBuffer buf = new StringBuffer();
475 <        buf.append("{");
474 >        StringBuilder sb = new StringBuilder();
475 >        sb.append("{");
476  
477          Iterator<Entry<K,V>> i = entrySet().iterator();
478          boolean hasNext = i.hasNext();
# Line 481 | Line 481 | public abstract class AbstractMap<K,V> i
481              K key = e.getKey();
482              V value = e.getValue();
483              if (key == this)
484 <                buf.append("(this Map)");
484 >                sb.append("(this Map)");
485              else
486 <                buf.append(key);
487 <            buf.append("=");
486 >                sb.append(key);
487 >            sb.append("=");
488              if (value == this)
489 <                buf.append("(this Map)");
489 >                sb.append("(this Map)");
490              else
491 <                buf.append(value);
491 >                sb.append(value);
492              hasNext = i.hasNext();
493              if (hasNext)
494 <                buf.append(", ");
494 >                sb.append(", ");
495          }
496  
497 <        buf.append("}");
498 <        return buf.toString();
497 >        sb.append("}");
498 >        return sb.toString();
499      }
500  
501      /**
# Line 555 | Line 555 | public abstract class AbstractMap<K,V> i
555           * Creates an entry representing the same mapping as the
556           * specified entry.
557           *
558 <         * @param entry the entry to copy.
558 >         * @param entry the entry to copy
559           */
560          public SimpleEntry(Entry<? extends K, ? extends V> entry) {
561              this.key   = entry.getKey();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines