It look like that there is a bug inside the AssignabilityChecker class of GWT 2.7.0.
If you use the method isAssignableFromRaw(JClassType from, JClassType to) to check weather something is assignable to the „to“ parameter or not, the method will always fail if the value of the parameter „to“ is „java.lang.object“.
The first thing this method does is to check if the „to“-parameter is the java.lang.object type. Therefor the method calls the method „isJavaLangObject(JClassType type)“. This method compares parameter type with type.getOracle().getJavaLangObject(). But type.getOracle().getJavaLangObject() does not return a raw type. To solve this problem, the value of type.getOracle().getJavaLangObject() must be converted to a raw type.
The method is used to
times. Once it is called from isAssignableFromGenericArrayType(JarrayType from,
JClassType to), where the method isJavaLangObject(to) will work correct The
second call is the one from isAssignableFromRaw, where the compare will fail.
To solve this problem, I have created a another method:
private static boolean isJavaLangObjectRawType(JClassType rawType) {
return rawType == convertToRawIfGeneric(rawType.getOracle().getJvaLangObject());
}
and call this method
from isAssignableFromRaw. Using this patch, everything works correct.
To test this error, you can download the mvp4g framework (trunk) from
and run the method:
testGeneratedClass
from the class:
com.mvp4g.rebind.config.loader.annotation.ServicesAnnotationsLoaderTest
I have created a patch and assigned it. Using the patch, the test will behave in the same way as it does with GWT 2.6.1.
Frank
Enviorement: OS X 10.10.1, Java 1.7, IntelliJ Ultimate Editition 14.0.2
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/3895a392-dd05-4450-813e-eceaf447adea%40googlegroups.com.--
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.
private static boolean isJavaLangObject(JClassType type) {
return type == type.getOracle().getJavaLangObject();
}
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-contributors+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit-contributors/fa42088b-e9ab-48dd-b252-618fee582a1a%40googlegroups.com.To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit-co...@googlegroups.com.