Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

复杂继承情况下 TypeUtils.getCollectionItemType() 获取类型错误导致反序列化失败 #2224

Closed
timandy opened this issue Jan 7, 2019 · 1 comment · Fixed by #2225
Labels
Milestone

Comments

@timandy
Copy link
Contributor

timandy commented Jan 7, 2019

TypeUtils.getCollectionItemType() 取了第一个泛型类型
以下情况下,不应该取第一个

public abstract class KeyedCollection<TKey, TItem> implements Collection<TItem>{
...
}

public class GoodsSkuSpecValueCollection extends KeyedCollection<String,GoodsSkuSpecValue> {
...
}

@Test
public void test() {
    String a = "[{\"specId\":\"chima\",\"specValueId\":\"chima_14\"}]";
    GoodsSkuSpecValueCollection collection = JSON.parseObject(a, GoodsSkuSpecValueCollection.class);
    Assert.assertNotNull(collection);
}

我稍后创建一个 pull request.

@wenshao
Copy link
Member

wenshao commented Jan 9, 2019

欢迎提交PR

wenshao added a commit that referenced this issue Jan 9, 2019
fix #2224 复杂继承情况下 TypeUtils.getCollectionItemType() 获取类型错误导致反序列化失败
timandy added a commit to timandy/fastjson that referenced this issue Feb 14, 2019
timandy added a commit to timandy/fastjson that referenced this issue Feb 15, 2019
timandy added a commit to timandy/fastjson that referenced this issue Feb 15, 2019
timandy added a commit to timandy/fastjson that referenced this issue Feb 15, 2019
timandy added a commit to timandy/fastjson that referenced this issue Feb 15, 2019
…erized type and item type is generic array
timandy added a commit to timandy/fastjson that referenced this issue Feb 15, 2019
…erized type and item type is generic array contains array
timandy added a commit to timandy/fastjson that referenced this issue Mar 4, 2019
timandy added a commit to timandy/fastjson that referenced this issue Mar 4, 2019
timandy added a commit to timandy/fastjson that referenced this issue Mar 4, 2019
timandy added a commit to timandy/fastjson that referenced this issue Mar 4, 2019
…erized type and item type is generic array
timandy added a commit to timandy/fastjson that referenced this issue Mar 4, 2019
…erized type and item type is generic array contains array
@wenshao wenshao added the bug label Mar 12, 2019
@wenshao wenshao added this to the 1.2.57 milestone Mar 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants