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/02/06 09:52:00 UTC
[21/38] 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
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/4699fe23
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/4699fe23
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/4699fe23
Branch: refs/heads/reference-guide
Commit: 4699fe238af07d25a87ef4ca8feadb0942e5fbda
Parents: 54a4370
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:38:52 2013 +0100
----------------------------------------------------------------------
.../wicket/core/util/lang/WicketObjects.java | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/4699fe23/wicket-core/src/main/java/org/apache/wicket/core/util/lang/WicketObjects.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/WicketObjects.java b/wicket-core/src/main/java/org/apache/wicket/core/util/lang/WicketObjects.java
index 779ef77..600ca4b 100644
--- a/wicket-core/src/main/java/org/apache/wicket/core/util/lang/WicketObjects.java
+++ b/wicket-core/src/main/java/org/apache/wicket/core/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);