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 2010/11/15 01:49:25 UTC

svn commit: r1035114 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java

Author: ivaynberg
Date: Mon Nov 15 00:49:24 2010
New Revision: 1035114

URL: http://svn.apache.org/viewvc?rev=1035114&view=rev
Log:
meh. this caching will probably slow things down. and it can be difficult to find all the places in code where caching should be invalidated. lets hold off until it is a hotspot.
Issue: WICKET-3166

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java?rev=1035114&r1=1035113&r2=1035114&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/Component.java Mon Nov 15 00:49:24 2010
@@ -430,16 +430,6 @@ public abstract class Component
 	};
 
 	/**
-	 * Keeps metadata about the visibility state of the component
-	 * 
-	 * The states are: null - not calculated, true and false
-	 */
-	private static final MetaDataKey<Boolean> VISIBLE_IN_HIERARCHY_CACHE_KEY = new MetaDataKey<Boolean>()
-	{
-		private static final long serialVersionUID = 1L;
-	};
-
-	/**
 	 * Keeps metadata about the enabled state of the component
 	 * 
 	 * The states are: null - not calculated, true and false
@@ -2148,21 +2138,15 @@ public abstract class Component
 	 */
 	public final boolean isVisibleInHierarchy()
 	{
-		Boolean state = getMetaData(VISIBLE_IN_HIERARCHY_CACHE_KEY);
-		if (state == null)
+		Component parent = getParent();
+		if (parent != null && !parent.isVisibleInHierarchy())
 		{
-			Component parent = getParent();
-			if (parent != null && !parent.isVisibleInHierarchy())
-			{
-				state = false;
-			}
-			else
-			{
-				state = determineVisibility();
-			}
-			setMetaData(VISIBLE_IN_HIERARCHY_CACHE_KEY, state);
+			return false;
+		}
+		else
+		{
+			return determineVisibility();
 		}
-		return state;
 	}
 
 	/**