I tried to reproduce the problem in GWT. I added following to
JParameterizedTypeTest
    assertType("Object").isAssignableFrom("List");
    assertType("Object").isAssignableFrom("Integer");

and both cases doesn't fail.

I also don't understand what you mean about converting java.lang.Object to
raw type. java.lang.Object is not a generic type so it cannot have a raw
type.

Can you provide the exact types that your are passing or better reproduce
the problem in JParameterizedTypeTest so we can take a look at the issue?


On Mon, Jan 19, 2015 at 2:07 AM, Frank Hossfeld <
[email protected]> wrote:

> Please can you prove that it is a bug or am I doing something wrong? I
> make an update to the AssignabilityChecker (this time with less code
> changes). If it is a bug, the changes should solve it.
>
> Am Samstag, 17. Januar 2015 14:34:36 UTC+1 schrieb Frank Hossfeld:
>
>> 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
>>
>> *https://code.google.com/p/mvp4g/source/checkout
>> <https://code.google.com/p/mvp4g/source/checkout>*
>>
>> 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
>>
>>
>>
>>
>>
>  --
> 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 [email protected].
> 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
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/3895a392-dd05-4450-813e-eceaf447adea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAN%3DyUA1Mx-S5Y3ziKbQGPX%3DKNTKV0wqv%3Dfqt0a30g5MrdsbAMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to