Closed GoogleCodeExporter closed 9 years ago
能够重现,要这样重现:
public void testArrayArgs(@Param("names") List<String>[] names)
Original comment by wendal1985@gmail.com
on 25 Mar 2011 at 6:31
Fix in r1927
但最好找多几个小白鼠测试一下
Original comment by wendal1985@gmail.com
on 25 Mar 2011 at 7:28
我用 JUnit 重现了这个问题,参看 r1934 + r1935
问题出在 AbstractAdaptor.init(Method method) 函数的 52 行:
Type[] types = method.getGenericParameterTypes();
原因是:
如果入口函数:public String f_B(@Param("ids") long[] ids) {
那么 types 就是 Class<T>(long[])
结果很正常
如果入口函数:public List<String> f_A(@Param("ids") long[] ids) {
那么 types 就是 GenericArrayTypeImpl
所以在 134 行 Class<?> clazz = Lang.getTypeClass(type); 执行的时候, 只能得到一个 long 而不是 long[]
这里我非常的奇怪,为啥 Lang.getTypeClass 遇到 GenericArrayTypeImpl
的时候,要取内部元素的类型? 这不是明显错的吗?
Original comment by zozoh...@gmail.com
on 26 Mar 2011 at 5:41
This issue was closed by revision r1936.
Original comment by zozoh...@gmail.com
on 26 Mar 2011 at 5:46
Original comment by zozoh...@gmail.com
on 26 Mar 2011 at 5:52
Original issue reported on code.google.com by
happyday...@gmail.com
on 25 Mar 2011 at 6:10