You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jr...@apache.org on 2010/08/28 04:08:28 UTC

svn commit: r990313 - /wicket/branches/wicket-1.4.x/wicket/src/main/java/org/apache/wicket/Component.java

Author: jrthomerson
Date: Sat Aug 28 02:08:27 2010
New Revision: 990313

URL: http://svn.apache.org/viewvc?rev=990313&view=rev
Log:
fix WICKET-3019 in 1.4

Peter Ertl supplied this patch.


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=990313&r1=990312&r2=990313&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 Sat Aug 28 02:08:27 2010
@@ -3546,9 +3546,11 @@ public abstract class Component implemen
 	{
 		if (!tag.getName().equalsIgnoreCase(name))
 		{
-			findMarkupStream().throwMarkupException(
-				"Component " + getId() + " must be applied to a tag of type '" + name + "', not " +
-					tag.toUserDebugString());
+			String msg = String.format("Component [%s] (path = [%s]) must be " +
+					                     "applied to a tag of type [%s], not: %s",
+			                           getId(), getPath(), name, tag.toUserDebugString());
+
+			findMarkupStream().throwMarkupException(msg);
 		}
 	}
 
@@ -3572,9 +3574,11 @@ public abstract class Component implemen
 			final String tagAttributeValue = tag.getAttributes().getString(key);
 			if (tagAttributeValue == null || !value.equalsIgnoreCase(tagAttributeValue))
 			{
-				findMarkupStream().throwMarkupException(
-					"Component " + getId() + " must be applied to a tag with '" + key +
-						"' attribute matching '" + value + "', not '" + tagAttributeValue + "'");
+				String msg = String.format("Component [%s] (path = [%s]) must be applied to a tag " +
+						                     "with [%s] attribute matching [%s], not [%s]",
+				                           getId(), getPath(), key, value, tagAttributeValue);
+
+				findMarkupStream().throwMarkupException(msg);
 			}
 		}
 	}