ClassCastException with spring-cloud-function 4.3.6 when a field of type Set is deserialized
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 70/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- java, spring-boot
- 领域
- backend
调研方向
在 Jackson 集成包中查找 CollectionLimitModule 以及它构建的 LimitedCollectionDeserializer;这个 bug 出在构造器参数上,它在需要集合类型的地方传入了集合的元素类型,导致每个受限集合都变成 ArrayList。先解压附带的复现项目并针对 4.3.6 运行其测试以看到 JsonMappingException,然后用本地构建复现同样的路径。完成的标准是:Set<String> 属性反序列化为 Set,List 的行为和 1000 项限制保持不变,并且该模块现有的测试通过。
由索引模型根据 Issue 内容生成。
描述
spring-cloud-function 4.3.6 registers a CollectionLimitModule on the JsonMapper it creates, to reject collections with more than 1000 items. Its LimitedCollectionDeserializer is created with the element type of the collection instead of the collection type, so it always creates an ArrayList. Any message or function argument with a Set property (for example a Set<String> that receives []) failed with JsonMappingException: ... expected type: [collection type; class java.util.Set ...]; actual type: java.util.ArrayList, problem: argument type mismatch. List properties were not affected. spring-cloud-function 4.3.5 does not have the problem.
The attached project has unit tests that reproduces the issue. All tests pass if you replace the value of spring-cloud-function.version from 4.3.6 to 4.3.5 in pom.xml.
- 主要语言
- Java
- 星标
- 1.1k
- 派生
- 655
- 平均合并
- 4 小时 54 分钟
- 30 天内合并 PR
- 10
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
spring-cloud/spring-cloud-function 的其他 Issue
-
GcfJarLayout omits GcfJarLauncher$NestedUrlStreamHandlerFactory, causing NoClassDefFoundError under the GCF invoker可能已有人在做 @zemiles 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 32/100
spring-cloud/spring-cloud-function#1544 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
spring-cloud/spring-cloud-function#1538 · 1 条评论 ·
维护者通常 1 天内回复
-
Kotlin function wrapper treats empty input as no input可能已有人在做 @seonwooj0810 今天认领。 未关闭5.0.x backport bug
难度 3/5 半天 新手友好度 30/100
spring-cloud/spring-cloud-function#1537 ·
维护者通常 1 天内回复
-
5.0.x backport bug
难度 4/5 3-5 天 新手友好度 22/100
spring-cloud/spring-cloud-function#1536 ·
维护者通常 1 天内回复
-
SmartCompositeMessageConverter fails with NullPointerException or ClassCastException in several conversion paths可能已有人在做 @seonwooj0810 于 1 天前认领。 未关闭5.0.x backport bug
难度 3/5 1-2 天 新手友好度 35/100
spring-cloud/spring-cloud-function#1535 ·
维护者通常 1 天内回复
查看 spring-cloud/spring-cloud-function 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 1/5 1 小时以内 新手友好度 80/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
aphtech/brailleblaster#209 ·
维护者通常 1 天内回复
-
payers.csv writes QOLS_AVG as NaN for every payer that had no members可能已有人在做 @DG47 今天认领。 未关闭
难度 1/5 1 小时以内 新手友好度 86/100
synthetichealth/synthea#1797 ·
维护者通常 19 天内回复
-
build enhancement security
难度 2/5 1-3 小时 新手友好度 78/100
midhunhk/lib-aeapps#54 ·