myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject svn commit: r418869 - in /myfaces/tomahawk/trunk/core/src: main/java/org/apache/myfaces/custom/tree2/UITreeData.java test/java/org/apache/myfaces/custom/tree2/UITreeDataTest.java
Date Mon, 03 Jul 2006 23:12:26 GMT
Author: schof
Date: Mon Jul  3 16:12:25 2006
New Revision: 418869

URL: http://svn.apache.org/viewvc?rev=418869&view=rev
Log:
Fixed decoding problem with "empty" facets.  (See TOMAHAWK-510)

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java
    myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/tree2/UITreeDataTest.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java?rev=418869&r1=418868&r2=418869&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java
(original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/tree2/UITreeData.java
Mon Jul  3 16:12:25 2006
@@ -37,6 +37,9 @@
 
 import org.apache.myfaces.shared_tomahawk.util.MessageUtils;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 /**
  * TreeData is a {@link UIComponent} that supports binding data stored in a tree represented
  * by a {@link TreeNode} instance.  During iterative processing over the tree nodes in the
@@ -50,6 +53,7 @@
  */
 public class UITreeData extends UIComponentBase implements NamingContainer
 {
+    private Log log = LogFactory.getLog(UITreeData.class);
 
     public static final String COMPONENT_TYPE = "org.apache.myfaces.Tree2";
     public static final String COMPONENT_FAMILY = "org.apache.myfaces.HtmlTree2";
@@ -493,7 +497,9 @@
 
             if (facet == null)
             {
-                throw new IllegalArgumentException("Unable to locate facet with the name:
" + node.getType());
+                log.warn("Unable to locate facet with the name: " + node.getType());
+                continue;
+                //throw new IllegalArgumentException("Unable to locate facet with the name:
" + node.getType());
             }
 
             switch (processAction)

Modified: myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/tree2/UITreeDataTest.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/tree2/UITreeDataTest.java?rev=418869&r1=418868&r2=418869&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/tree2/UITreeDataTest.java
(original)
+++ myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/custom/tree2/UITreeDataTest.java
Mon Jul  3 16:12:25 2006
@@ -30,8 +30,6 @@
  */
 public class UITreeDataTest extends AbstractTreeTestCase
 {
-    private NodeSimulator nodeSim;
-
     /**
      * Constructor
      * @param name String
@@ -166,6 +164,18 @@
 
         tree.setNodeId("0:1:0");
         assertFalse("Node O:1:0 should not be expanded", tree.isNodeExpanded());
+    }
+
+    /**
+     * Its possible that a facet will be empty on the decode if it contained only EL text.
+     * So its wrong to throw an exception when this is the case.  (See TOMAHAWK-510)
+     *
+     * @throws Exception
+     */
+    public void testEmptyFacet() throws Exception
+    {
+        tree.processDecodes(facesContext);
+
     }
 
     public static Test suite()



Mime
View raw message