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

[22/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

Take the size of the clone.


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/2e068210
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/2e068210
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/2e068210

Branch: refs/heads/reference-guide
Commit: 2e068210c1313c0016854b59a62958f5fa5e8891
Parents: 4699fe2
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Thu Jan 31 14:43:02 2013 +0100
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Thu Jan 31 14:43:02 2013 +0100

----------------------------------------------------------------------
 .../wicket/core/util/lang/WicketObjects.java       |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/2e068210/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 600ca4b..464a212 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
@@ -417,19 +417,25 @@ public class WicketObjects
 	 */
 	public static long sizeof(final Serializable object)
 	{
+		Serializable target = object;
+
 		if (object instanceof Component)
 		{
 			// clone to not detach the original component (WICKET-5013, 5014)
 			Component clone = (Component) cloneObject(object);
 			clone.detach();
+
+			target = clone;
 		}
 		else if (object instanceof IDetachable)
 		{
 			// clone to not detach the original IDetachable (WICKET-5013, 5014)
 			IDetachable clone = (IDetachable) cloneObject(object);
 			clone.detach();
+
+			target = clone;
 		}
 
-		return objectSizeOfStrategy.sizeOf(object);
+		return objectSizeOfStrategy.sizeOf(target);
 	}
 }