Repository navigation
fix(bean)!: 回移 Map 导出与异常转换修复至 5.0.3 - #386
Merged
Merged
Conversation
回移 transient 排除、getter 单次读取和双向异常转换 SPI。 保留国际化、业务字段和远端诊断,核心异常恢复为对应无栈实现。 修复 TraceSourceException 在匿名或局部类诊断输出时的空指针。 Refs: #385 BREAKING CHANGE: Bean 转 Map 不再导出 transient 属性;Throwable 转 Map 使用固定描述,不再枚举 cause、suppressed 等任意属性。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
回移 PR #385 的累计修复至 5.0.3,基线为 5bc6303,保留本分支现有的 record 和泛型 Map 转换语义。
Bean 转 Map 会读取本应仅保留在本地的 transient 属性,非空引用属性的 getter 还会重复执行。现在在读取前排除 transient 字段(含继承字段)及 JavaBeans Transient 属性,对参与复制的属性只求值一次,保留只读 Bean、record、fluent、Extendable 和 getProperty 的用途。
异常转换使用双向 ExceptionConverter SPI:
验证:
兼容影响:Bean 转 Map 不再导出 transient 属性,显式 include 也不能绕过;Throwable 转 Map 不再枚举原始 cause、suppressed、stackTrace 对象。detail 为诊断文本,不解析成异常对象图。普通 Bean 内非 transient 的异常、args 和校验详情中的业务值保持浅引用,任意业务值能否序列化取决于值本身。未支持的具体异常目标需由 SPI 提供可赋值实现,否则明确失败。