You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by iv...@apache.org on 2007/03/26 03:58:16 UTC

svn commit: r522401 - /incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java

Author: ivaynberg
Date: Sun Mar 25 18:58:15 2007
New Revision: 522401

URL: http://svn.apache.org/viewvc?view=rev&rev=522401
Log:
detach component always, even if attach() has not been explicitly called, possibly fixes WICKET-418

Modified:
    incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java

Modified: incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java
URL: http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java?view=diff&rev=522401&r1=522400&r2=522401
==============================================================================
--- incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java (original)
+++ incubator/wicket/branches/wicket-1.x/jdk-1.4/wicket/src/main/java/wicket/Component.java Sun Mar 25 18:58:15 2007
@@ -2769,19 +2769,16 @@
 	 */
 	public final void detach()
 	{
-		if (getFlag(FLAG_ATTACHED))
-		{
-			setFlag(FLAG_DETACHING, true);
-			onDetach();
-			if (getFlag(FLAG_DETACHING))
-			{
-				throw new IllegalStateException(Component.class.getName()
-						+ " has not been properly detached. Something in the hierarchy of "
-						+ getClass().getName()
-						+ " has not called super.onDetach() in the override of onDetach() method");
-			}
-			setFlag(FLAG_ATTACHED, false);
+		setFlag(FLAG_DETACHING, true);
+		onDetach();
+		if (getFlag(FLAG_DETACHING))
+		{
+			throw new IllegalStateException(Component.class.getName()
+					+ " has not been properly detached. Something in the hierarchy of "
+					+ getClass().getName()
+					+ " has not called super.onDetach() in the override of onDetach() method");
 		}
+		setFlag(FLAG_ATTACHED, false);
 
 		detachChildren();
 	}
@@ -3194,7 +3191,7 @@
 		private static final long serialVersionUID = 1L;
 
 	};
-	
+
 	/**
 	 * @deprecated
 	 */