In general we try to be null-intolerant, although I don't know how consistent we are about it. Basically, nulls should never be quietly cleaned up for you but rather should fail fast if practical. If null is a legal value, it should serve a specific purpose.
On Tue, Jun 7, 2011 at 12:44 AM, Thomas Broyer <[email protected]> wrote: > On Tue, Jun 7, 2011 at 1:32 AM, Christoph Kern <[email protected]> wrote: > > It turns out it was easier to fix the specific case this broke in client > > code (a test that ended up passing null for a URL). > > Which raises the question, should Image gracefully handle "null" for > URLs, > > or should the API docs clarify that non-null values are expected? Is > there > > a convention for handling nulls in the GWT API? > > SafeHtmlUtils at least doesn't handle 'null' (and will throw NPEs). > I'd rather have SafeUri follow the same pattern, whether it is to > throw NPEs or is changed as proposed here for > unsafeCastFromUntrustedString. > -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
