You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2013/01/31 14:40:39 UTC
git commit: WICKET-5013 Wicket Enclosure fails with more than one
component WICKET-5014 Changes in WicketObjects.sizeof(final Serializable
object) clashes with in AjaxResponse
Updated Branches:
refs/heads/wicket-1.5.x d3e8d96e0 -> 66b03520c
WICKET-5013 Wicket Enclosure fails with more than one component
WICKET-5014 Changes in WicketObjects.sizeof(final Serializable object) clashes with <header-contribution> in AjaxResponse
Clone the object before detaching it to calculate its size. Apparently it is not that safe to detach the page at any time of its lifecycle.
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/66b03520
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/66b03520
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/66b03520
Branch: refs/heads/wicket-1.5.x
Commit: 66b03520c3812c181698ef7c4e607bbd101828b1
Parents: d3e8d96
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Jan 31 14:34:05 2013 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu Jan 31 14:39:19 2013 +0100
----------------------------------------------------------------------
.../org/apache/wicket/util/lang/WicketObjects.java | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/66b03520/wicket-core/src/main/java/org/apache/wicket/util/lang/WicketObjects.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/util/lang/WicketObjects.java b/wicket-core/src/main/java/org/apache/wicket/util/lang/WicketObjects.java
index 27ea1be..df9e767 100644
--- a/wicket-core/src/main/java/org/apache/wicket/util/lang/WicketObjects.java
+++ b/wicket-core/src/main/java/org/apache/wicket/util/lang/WicketObjects.java
@@ -419,11 +419,15 @@ public class WicketObjects
{
if (object instanceof Component)
{
- ((Component) object).detach();
+ // clone to not detach the original component (WICKET-5013, 5014)
+ Component clone = (Component) cloneObject(object);
+ clone.detach();
}
else if (object instanceof IDetachable)
{
- ((IDetachable) object).detach();
+ // clone to not detach the original IDetachable (WICKET-5013, 5014)
+ IDetachable clone = (IDetachable) cloneObject(object);
+ clone.detach();
}
return objectSizeOfStrategy.sizeOf(object);