I've brought this up before on different forums, but it keeps coming
back to bite me. I know exactly which types I want to be serialized,
and with the new RPC blacklists/whitelists I have control over what
gets put in my serialization policy (thank you!). In my case, I do
something like this to ensure that only the specific collections I
want are allowed:
<extend-configuration-property name="rpc.blacklist" value="-.*List"/>
<extend-configuration-property name="rpc.blacklist" value="-.*Map"/>
<extend-configuration-property name="rpc.blacklist"
value="-.*Collection"/>
<extend-configuration-property name="rpc.blacklist"
value="+java.util.HashMap"/>
<extend-configuration-property name="rpc.blacklist"
value="+java.util.LinkedHashMap"/>
<extend-configuration-property name="rpc.blacklist"
value="+java.util.ArrayList"/>
However, there are times when I don't want to use generics with one of
these collections. If I ever have an RPC service with a return type
of plain ArrayList, I get the following output when compiling GWT:
Return type: java.util.ArrayList
java.util.ArrayList
Verifying instantiability
java.util.ArrayList<? extends java.lang.Object>
[WARN] Checking all subtypes of Object which qualify for
serialization
My question is, when would this behavior ever be desirable? Would you
ever want to deploy a GWT app where this was happening? Furthermore,
it prints this warning even if I use an rpc blacklist (at least I
haven't been able to get it to go away). Digging into the GWT source
code, I see this in SerializableTypeOracleBuilder.java, line 1228:
if (isRawMapOrRawCollection(classOrInterface)) {
/*
* Backwards compatibility. Raw collections or maps force all
object
* subtypes to be considered.
*/
checkAllSubtypesOfObject(logger, parent, problems);
}
I don't need this for backward compatibility. Let's add a module
property on RemoteService.gwt.xml that will allow this behavior to be
turned off. Thoughts?
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.