scolebourne 2004/04/09 07:42:37
Modified: collections RELEASE-NOTES.html
collections/src/java/org/apache/commons/collections/map
Flat3Map.java
Log:
Handle infinite loops in toString of Flat3Map
Revision Changes Path
1.31 +1 -0 jakarta-commons/collections/RELEASE-NOTES.html
Index: RELEASE-NOTES.html
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/RELEASE-NOTES.html,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- RELEASE-NOTES.html 9 Apr 2004 14:38:47 -0000 1.30
+++ RELEASE-NOTES.html 9 Apr 2004 14:42:36 -0000 1.31
@@ -60,6 +60,7 @@
<li>Map/BidiMap implementations only checked key and not value in entry set
contains(Object) and remove(Object)</li>
<li>AbstractHashedMap subclasses failed to clone() correctly [27159]</li>
<li>ExtendedProperties - Close input stream in constructor [27737]</li>
+<li>Flat3Map - Handle infinite loops in toString</li>
</ul>
<center><h3>JAVADOC</h3></center>
1.15 +10 -8
jakarta-commons/collections/src/java/org/apache/commons/collections/map/Flat3Map.java
Index: Flat3Map.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/Flat3Map.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Flat3Map.java 31 Mar 2004 23:18:56 -0000 1.14
+++ Flat3Map.java 9 Apr 2004 14:42:36 -0000 1.15
@@ -103,6 +103,7 @@
* Constructor copying elements from another map.
*
* @param map the map to copy
+ * @throws NullPointerException if the map is null
*/
public Flat3Map(Map map) {
super();
@@ -325,7 +326,8 @@
/**
* Puts all the values from the specified map into this map.
*
- * @param map
+ * @param map the map to add
+ * @throws NullPointerException if the map is null
*/
public void putAll(Map map) {
int size = map.size();
@@ -1094,19 +1096,19 @@
buf.append('{');
switch (size) { // drop through
case 3:
- buf.append(key3);
+ buf.append((key3 == this ? "(this Map)" : key3));
buf.append('=');
- buf.append(value3);
+ buf.append((value3 == this ? "(this Map)" : value3));
buf.append(',');
case 2:
- buf.append(key2);
+ buf.append((key2 == this ? "(this Map)" : key2));
buf.append('=');
- buf.append(value2);
+ buf.append((value2 == this ? "(this Map)" : value2));
buf.append(',');
case 1:
- buf.append(key1);
+ buf.append((key1 == this ? "(this Map)" : key1));
buf.append('=');
- buf.append(value1);
+ buf.append((value1 == this ? "(this Map)" : value1));
}
buf.append('}');
return buf.toString();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]