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

优化统一MergedBinder对null结果、失败结果的处理 #896

Merged
merged 12 commits into from
Aug 1, 2024

Conversation

ForliyScarlet
Copy link
Member

当一个监听函数的某个参数存在多个绑定器时:

评估过程中:

  • 如果参数不可为 null、评估结果为成功但是内容为 null、同时参数是可选的,
    则会忽略此结果,视为无结果。
  • 如果评估结果为失败,则暂记此异常,并视为无结果。

期间,遇到任何成功的、不符合上述会造成“无结果”条件的,
直接返回此评估结果,不再继续评估。

当所有binder评估完成,但没有遇到任何结果:

  • 如果参数为可选,输出debug日志并使用 [ParameterBinder.Ignore] 标记直接使用默认值。
  • 否则,返回 [Result.failure] 错误结果,并追加之前暂记的所有异常堆栈。

resolve #895

@ForliyScarlet ForliyScarlet added the 缺陷 一些存在不影响正常结果的缺陷 label Jul 31, 2024
@ForliyScarlet
Copy link
Member Author

ForliyScarlet commented Jul 31, 2024

Qodana Community for JVM

10 new problems were found

Inspection name Severity Problems
Unresolved reference in KDoc 🔶 Warning 7
Constant conditions 🔶 Warning 3

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@ForteScarlet ForteScarlet merged commit defde35 into v4-dev Aug 1, 2024
6 checks passed
@ForteScarlet ForteScarlet deleted the optimize-895 branch August 1, 2024 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
缺陷 一些存在不影响正常结果的缺陷
Projects
None yet
Development

Successfully merging this pull request may close these issues.

通过@FilterValue获取(Int/String)的参数时出现(NullPointerException/BindException)异常
2 participants