I have a gwt aplication, during compilation I get the error:
Scanning for additional dependencies: file:/D:/projects/healthplanel_trunk/clinics-gwt-client/src/com/clinics/gwt/shared/UserServiceAsync.java
Computing all possible rebind results for ‘com.clinics.gwt.shared.UserService’
Rebinding com.clinics.gwt.shared.UserService
Invoking generator com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator
Generating client proxy for remote service interface ‘com.clinics.gwt.shared.UserService’
Analyzing ‘com.clinics.gwt.shared.UserService’ for serializable types
Analyzing methods:
public abstract com.clinics.gwt.shared.query.GQueryResult listAdmins(com.clinics.gwt.shared.query.GQueryParams queryParams)
Parameter: com.clinics.gwt.shared.query.GQueryParams queryParams
com.clinics.gwt.shared.query.GQueryParams
Verifying instantiability
com.clinics.gwt.shared.query.GQueryParams
Analyzing the fields of type ‘com.clinics.gwt.shared.query.GQueryParams’ that qualify for serialization
private java.util.List> filters
java.util.List>
Verifying instantiability
java.util.Vector>
Checking parameters of ‘java.util.Vector>’
Checking type argument 0 of type ‘java.util.Vector’ because it is directly exposed in this type or in one of its subtypes
com.clinics.gwt.shared.query.GFilterBy
Verifying instantiability
com.clinics.gwt.shared.query.GFilterBy
Checking parameters of ‘com.clinics.gwt.shared.query.GFilterBy’
Checking type argument 0 of type ‘com.clinics.gwt.shared.query.GFilterBy’ because it is directly exposed in this type or in one of its subtypes
java.io.Serializable
Verifying instantiability
java.util.HashMap
[WARN] Checking all subtypes of Object which qualify for serialization
My code is:
public class GQueryParams implements IsSerializable {
private static final long serialVersionUID = 1L;
private int offset = 0;
private int maxCount = -1; // -1 means all
private ArrayList<GOrderBy> orders = new ArrayList<GOrderBy>();
private ArrayList<NoSqlOrderBy> noSqlOrders = new ArrayList<NoSqlOrderBy>();
private ArrayList<GFilterBy<?>> filters = new ArrayList<GFilterBy<?>>();
And:
public class GFilterBy<T extends Serializable> implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private GFilterOperation operation;
private T value;
What’s wrong, could you please help me with it?
GFilterBy<?>basically accepts everything (everything that implementsSerializable), so the generator has to scan the whole classpath for every applicable class and generate the appropriate ser/deserialization code for each of them.This is generally not what you want, hence the warning.
The rule of thumb is to always be as specific as possible in types sent over the wire with GWT-RPC; and
?obviously violates that rule.