Monday, February 20, 2012

GWT.create - why the ? wildcard?

I've just been caught out by a ClassCastException from GWT.create, it
turned out to be a simple copy/paste fail when writing unit tests but
it got me thinking.

How come GWT.create is defined like so -

public static <T> T create(Class<?> classLiteral) {

instead of like so -

public static <TArg, TRet extends TArg> TRet create(Class<TArg>
classLiteral) {

?

Chris

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate