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 2009/07/20 22:50:30 UTC

svn commit: r796002 - /wicket/trunk/wicket/src/main/java/org/apache/wicket/model/StringResourceModel.java

Author: ivaynberg
Date: Mon Jul 20 20:50:30 2009
New Revision: 796002

URL: http://svn.apache.org/viewvc?rev=796002&view=rev
Log:
WICKET-2381 IModel parameters of StringResourceModel not getting detached
Issue: WICKET-2381

Modified:
    wicket/trunk/wicket/src/main/java/org/apache/wicket/model/StringResourceModel.java

Modified: wicket/trunk/wicket/src/main/java/org/apache/wicket/model/StringResourceModel.java
URL: http://svn.apache.org/viewvc/wicket/trunk/wicket/src/main/java/org/apache/wicket/model/StringResourceModel.java?rev=796002&r1=796001&r2=796002&view=diff
==============================================================================
--- wicket/trunk/wicket/src/main/java/org/apache/wicket/model/StringResourceModel.java (original)
+++ wicket/trunk/wicket/src/main/java/org/apache/wicket/model/StringResourceModel.java Mon Jul 20 20:50:30 2009
@@ -462,6 +462,7 @@
 		}
 	}
 
+
 	/**
 	 * Gets the string currently represented by this string resource model. The string that is
 	 * returned may vary for each call to this method depending on the values contained in the model
@@ -658,6 +659,19 @@
 			model.detach();
 		}
 
+		// some parameters can be imodels, detach them
+		if (parameters != null)
+		{
+			for (Object parameter : parameters)
+			{
+				if (parameter instanceof IModel<?>)
+				{
+					((IModel<?>)parameter).detach();
+				}
+			}
+		}
+
+
 		// Null out references
 		localizer = null;
 		locale = null;