Better error message on garbage in text.
Review at http://gwt-code-reviews.appspot.com/748801
Review by: chenglee@google.com
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@8513 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/src/com/google/gwt/uibinder/client/UiFactory.java b/user/src/com/google/gwt/uibinder/client/UiFactory.java
index 148aae0..fdcd24e 100644
--- a/user/src/com/google/gwt/uibinder/client/UiFactory.java
+++ b/user/src/com/google/gwt/uibinder/client/UiFactory.java
@@ -23,7 +23,7 @@
/**
* Marks a method that may be called as an alternative to a GWT.create call in a
- * {@link UiBinder} template. The parameter names of the constructor are treated
+ * {@link UiBinder} template. The parameter names of the method are treated
* as required xml element attribute values.
* <p>
* It is an error to apply this annotation to more than one method of a given
diff --git a/user/src/com/google/gwt/uibinder/rebind/XMLElement.java b/user/src/com/google/gwt/uibinder/rebind/XMLElement.java
index 96d49e0..9e283d1 100644
--- a/user/src/com/google/gwt/uibinder/rebind/XMLElement.java
+++ b/user/src/com/google/gwt/uibinder/rebind/XMLElement.java
@@ -485,7 +485,9 @@
// Make sure there are no children left but empty husks
for (XMLElement child : consumeChildElementsNoEmptyCheck()) {
if (child.hasChildNodes() || child.getAttributeCount() > 0) {
- logger.die(this, "Element has illegal child %s", child);
+ logger.die(this, "Illegal child %s in a text-only context. "
+ + "Perhaps you are trying to use unescaped HTML "
+ + "where text is required, as in a HasText widget?", child);
}
}
diff --git a/user/src/com/google/gwt/user/client/ui/HTMLPanel.java b/user/src/com/google/gwt/user/client/ui/HTMLPanel.java
index f904987..3fd0e6b 100644
--- a/user/src/com/google/gwt/user/client/ui/HTMLPanel.java
+++ b/user/src/com/google/gwt/user/client/ui/HTMLPanel.java
@@ -107,7 +107,9 @@
}
/**
- * Adds a child widget to the panel, contained within an HTML element.
+ * Adds a child widget to the panel, contained within an HTML
+ * element. It is up to the caller to ensure that the given element
+ * is a child of this panel's root element.
*
* @param widget the widget to be added
* @param elem the element within which it will be contained