I have a custom generator that generates code only for somes classes in my project. The following code is at the beginning of the generate method, and puts all the classes I will need to work on in the clazzes list
TypeOracle oracle = context.getTypeOracle();
JClassType markerInterfaceType = oracle.findType(MY_PARENT_CLASS.class.getName());
List<JClassType> clazzes = new ArrayList<JClassType>();
for (JClassType classType : oracle.getTypes()) {
if (!classType.equals(markerInterfaceType)
&& classType.isAssignableTo(markerInterfaceType)) {
clazzes.add(classType);
}
}
This code has been unchanged for more than a year, but since last week it seems that a few classes are not taken into account by the generator.
After some digging, i found that those classes are not even in the list returned by oracle.getTypes()
oracle.findType(MISSING_CLASS.class.getName()) returns nullMy best guess would be that i have a cache problem somewhere, but i have no idea where to look.
Maybe too late for the answer but I was facing this issue for the last 3 days. No amount of clearing gwt-UnitCache folder was helping. Finally found the problem. The class which was not getting picked up by oracle had a reference of a gwt-ext class and I had not inherited gwt-ext in my module definition(.gwt.xml file). Removing that reference fixed the problem. So, using anything in your class which might not be referenced in your module definition or is not part of can cause your class not getting picked up by Oracle. Cheers!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With