This question is based on an answer I received for another question : https://stackoverflow.com/a/3060233/323357
My understanding is that the use of interfaces to declare return types and parameters types in my services forces the compiler to generate multiple compilation units, which increase my compile time and the size of generated files.
I don't think this is the case, but does the latest versions of gwt compiler (2.4 - 2.5) have a way to detect unnecessary compilation units...
for local variables and parameters?
void someFunction() { ArrayList<String> list = new ArrayList<String>(); privateFunction(list); //only use of the private function } private void privateFunction(List<String> list) { Set<Integer> set = new HashSet<Integer>(); //do stuff without reallocating list or set }
for final members?
private final Interface member = new InterfaceImpl(); @override Interface getInterface() { return this.member; }
for return type?
List<String> myFunction() { List<String> ret = new ArrayList<String>(); //do stuff and fill the list return ret; }
in services?
//Service Interface List<String> myService(); //Service implementation List<String> myService() { List<String> ret = new ArrayList<String>(); //do stuff and fill the list return ret; }