Author: mgrigorov
Date: Sun Aug 14 09:41:21 2011
New Revision: 1157505

URL: http://svn.apache.org/viewvc?rev=1157505&view=rev
Log:
Log which component makes the page stateful with DEBUG log message.
This makes StatelessChecker from -devutils redundant.


Modified:
    wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Page.java

Modified: wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Page.java
URL: 
http://svn.apache.org/viewvc/wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Page.java?rev=1157505&r1=1157504&r2=1157505&view=diff
==============================================================================
--- wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Page.java 
(original)
+++ wicket/trunk/wicket-core/src/main/java/org/apache/wicket/Page.java Sun Aug 
14 09:41:21 2011
@@ -530,33 +530,26 @@ public abstract class Page extends Marku
 
                if (stateless == null)
                {
-                       Boolean returnValue = visitChildren(Component.class, 
new IVisitor<Component, Boolean>()
-                       {
-                               public void component(final Component 
component, final IVisit<Boolean> visit)
+                       Component statefulComponent = 
visitChildren(Component.class,
+                               new IVisitor<Component, Component>()
                                {
-                                       if (!component.isStateless())
+                                       public void component(final Component 
component, final IVisit<Component> visit)
                                        {
-                                               visit.stop(Boolean.FALSE);
+                                               if (!component.isStateless())
+                                               {
+                                                       visit.stop(component);
+                                               }
                                        }
-                               }
-                       });
-                       if (returnValue == null)
-                       {
-                               stateless = Boolean.TRUE;
-                       }
-                       else
+                               });
+
+                       stateless = statefulComponent == null;
+
+                       if (log.isDebugEnabled() && !stateless.booleanValue() 
&& getStatelessHint())
                        {
-                               stateless = returnValue;
+                               log.debug("Page '{}' is not stateless because 
of component with path '{}'.", this,
+                                       
statefulComponent.getPageRelativePath());
                        }
 
-                       // TODO (matej_k): The stateless hint semantics has 
been changed, this warning doesn't
-                       // work anymore. but we don't really have
-                       // alternative to this
-                       /*
-                        * if (!stateless.booleanValue() && getStatelessHint()) 
{ log.warn("Page '" + this + "'
-                        * is not stateless because of '" + returnArray[0] + "' 
but the stateless hint is set to
-                        * true!"); }
-                        */
                }
 
                return stateless;


Reply via email to