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:48:56 UTC
svn commit: r1035113 -
/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java
Author: ivaynberg
Date: Mon Nov 15 00:48:56 2010
New Revision: 1035113
URL: http://svn.apache.org/viewvc?rev=1035113&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/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java
Modified: wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java?rev=1035113&r1=1035112&r2=1035113&view=diff
==============================================================================
--- wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java (original)
+++ wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java Mon Nov 15 00:48:56 2010
@@ -696,17 +696,6 @@ public abstract class Component implemen
private static final long serialVersionUID = 1L;
};
- /**
- * 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;
- };
-
-
/** Component flags. See FLAG_* for possible non-exclusive flag values. */
private int flags = FLAG_VISIBLE | FLAG_ESCAPE_MODEL_STRINGS | FLAG_VERSIONED | FLAG_ENABLED |
FLAG_IS_RENDER_ALLOWED | FLAG_VISIBILITY_ALLOWED;
@@ -2223,21 +2212,15 @@ public abstract class Component implemen
*/
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;
}
/**