You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2005/06/16 03:04:03 UTC
cvs commit: jakarta-tapestry/framework/src/test/org/apache/tapestry/form TestListEditMap.java
hlship 2005/06/15 18:04:03
Modified: . status.xml
framework/src/java/org/apache/tapestry/form ListEditMap.java
framework/src/test/org/apache/tapestry/form
TestListEditMap.java
Log:
TAPESTRY-261: ListEditMap can return null from getDeletedKeys()
Revision Changes Path
1.129 +1 -0 jakarta-tapestry/status.xml
Index: status.xml
===================================================================
RCS file: /home/cvs/jakarta-tapestry/status.xml,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -r1.128 -r1.129
--- status.xml 16 Jun 2005 00:51:11 -0000 1.128
+++ status.xml 16 Jun 2005 01:04:03 -0000 1.129
@@ -77,6 +77,7 @@
<action type="add" dev="HLS">Add a page explicitly discussing JDK and library dependencies.</action>
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-337">Incorrect link to Spring integration docs in FAQ</action>
<action type="fix" dev="HLS" fixes-bug="TAPESTRY-304">Non thread safe documentation example</action>
+ <action type="fix" dev="HLS" fixes-bug="TAPESTRY-261">ListEditMap can return null from getDeletedKeys()</action>
</release>
<release version="4.0-alpha-3" date="May 16 2005">
<action type="add" dev="HLS">Add initial support for the validator: binding prefix.</action>
1.5 +12 -2 jakarta-tapestry/framework/src/java/org/apache/tapestry/form/ListEditMap.java
Index: ListEditMap.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/form/ListEditMap.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ListEditMap.java 20 May 2005 12:46:08 -0000 1.4
+++ ListEditMap.java 16 Jun 2005 01:04:03 -0000 1.5
@@ -15,6 +15,7 @@
package org.apache.tapestry.form;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -191,7 +192,8 @@
}
/**
- * Returns the deleted keys in an unspecified order. May return null if no keys are deleted.
+ * Returns the deleted keys in an unspecified order. Returns a List, which may be empty if no
+ * keys have been deleted.
*/
public List getDeletedKeys()
@@ -219,10 +221,18 @@
_deletedKeys = null;
}
+ /**
+ * Invoked to convert a set into a List.
+ *
+ * @param set
+ * a set (which may be empty or null)
+ * @return a list (possibly empty) of the items in the set
+ */
+
protected List convertSetToList(Set set)
{
if (Tapestry.isEmpty(set))
- return null;
+ return Collections.EMPTY_LIST;
return new ArrayList(set);
}
1.3 +2 -2 jakarta-tapestry/framework/src/test/org/apache/tapestry/form/TestListEditMap.java
Index: TestListEditMap.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/form/TestListEditMap.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestListEditMap.java 20 May 2005 12:46:08 -0000 1.2
+++ TestListEditMap.java 16 Jun 2005 01:04:03 -0000 1.3
@@ -52,7 +52,7 @@
checkList("all values", new Object[]
{ BeanLifecycle.REQUEST, BeanLifecycle.PAGE, BeanLifecycle.RENDER }, m.getValues());
- assertNull(m.getDeletedKeys());
+ assertTrue(m.getDeletedKeys().isEmpty());
}
public void testGet()
@@ -160,7 +160,7 @@
checkList("keys after purge", new Object[]
{ "request", "page" }, m.getKeys());
- assertNull(m.getDeletedKeys());
+ assertTrue(m.getDeletedKeys().isEmpty());
m.purgeDeletedKeys();
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org