Author: ivaynberg
Date: Thu Apr 19 13:05:46 2007
New Revision: 530534

URL: http://svn.apache.org/viewvc?view=rev&rev=530534
Log:
added argument guards

Modified:
    
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java?view=diff&rev=530534&r1=530533&r2=530534
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/ajax/AjaxRequestTarget.java
 Thu Apr 19 13:05:46 2007
@@ -294,6 +294,18 @@
         */
        public final void addChildren(MarkupContainer parent, Class 
childCriteria)
        {
+               if (parent == null)
+               {
+                       throw new IllegalArgumentException("Argument `parent` 
cannot be null");
+               }
+               if (childCriteria == null)
+               {
+                       throw new IllegalArgumentException(
+                                       "Argument `childCriteria` cannot be 
null. If you want to traverse all components use `"
+                                                       + 
Component.class.getName() + ".class` as the value for this argument");
+               }
+               
+               
                parent.visitChildren(childCriteria, new Component.IVisitor()
                {
 
@@ -368,7 +380,8 @@
 
        /**
         * Sets the focus in the browser to the given component. The markup id 
must
-        * be set. If the component is null the focus will not be set to any 
component.
+        * be set. If the component is null the focus will not be set to any
+        * component.
         * 
         * @param component
         *            The component to get the focus or null.


Reply via email to