dwr2.0.3 give me a warn about missing type info, even if i add signatures in dwr.xml

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

dwr2.0.3 give me a warn about missing type info, even if i add signatures in dwr.xml

tassemble
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: dwr2.0.3 give me a warn about missing type info, even if i add signatures in dwr.xml

david@butterdev.com
Thanks for looking into this.  I took a quick look at the code and it
appears to confirm what you are seeing.  The hashCode method on
TypeHintContext may be the issue:

     public int hashCode()
     {
         return method.hashCode() + parameterNumber +
parameterNumberTree.hashCode();
     }

parameterNumberTree is an Arraylist.  SignatureParser is responsible for
putting the TypeHintContext into the ConverterManagers extraTypeInfoMap.
  When the new TypeHintContext is created in the CollectionConverter a
new parameterNumberTree list is created, resulting in the mismatch.  We
will look into it.

On 2013-10-08 07:50, [hidden email] wrote:

> Hello, i like dwr very much. But the warn message is annoyed! I try to
> find the problem.
>
> MY FUNCTION LIKE THIS:
> public class CourseraCourseBean {
>
> public List<OnlineCourseLanguageDto> getCourseLanguages(List<Long>
> cateList, boolean startingSoon) {
>
> //code here
>
> }
> }
>
> i have already add signatures in dwr.xml
>
> <dwr>
> <allow>
> ...
> </allow>
>
>  <signatures>
>  <![CDATA[
>  import java.util.List;
>  import java.lang.Long;
>  import com.example.CourseraCourseBean;
>  CourseraCourseBean.getCourseLanguages(List< Long> cateList, boolean
> startingSoon);
>  ]]>
>  </signatures>
> </dwr>
>
> but it still give me the warning message:
> Missing type info for getCourseLanguages(0<0>). Assuming this is a map
> with String keys. Please add to <signatures> in dwr.xml
>
> so i try to debug it.
>
> i find Long type convert to null in code below.
> CollectionConverter.java
>
>  TypeHintContext icc = inctx.getCurrentTypeHintContext();
>
>  TypeHintContext subthc = icc.createChildContext(0); //new
> TypeHintContext
>
>  Class subtype = subthc.getExtraTypeInfo();//this return null
>
> this is because the TypeHintContext in extraTypeInfoMap hashCode is
> -625501083 while the hashCode of new TypeHintContext which is created
> by icc.createChildContext(0) is -625501053. This will lead
> subthc.getExtraTypeInfo() to return null
>
> my dwr version 2.0.3, I also test 2.0.10. The result of both two are
> same, both have the warning message.
>
> please help! thx!!!