We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Boolean的get方法与is方法共存时无法预测会调用哪个方法
以下测试用例能否通过不可预测
import com.alibaba.fastjson2.JSON; import lombok.Data; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.fail; public class FastJsonBooleanTest { @Data static class A { private Boolean success; public Boolean isSuccess() { fail(); return null; } } @Test void test() { System.out.println(JSON.toJSONString(new A())); } }
按照JavaBean约定,boolean对应方法以is开头,Boolean对应方法以get开头 建议忽略以is开头的Boolean方法,或明确指定这种情况下应该以哪个方法为优先
猜测获取FiledWriter时使用了并发扫描并进行了全局缓存,导致所有后续结果会以缓存结果为准
The text was updated successfully, but these errors were encountered:
fix Boolean getBoolean() and Boolean isBoolean() method resolve o…
Boolean getBoolean()
Boolean isBoolean()
a83ba3d
…rder, for issue #1133
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.25-SNAPSHOT/ 问题已修复,请帮忙用2.0.25-SNAPSHOT版本验证,2.0.25预计在3月中旬发布
Sorry, something went wrong.
727c5d2
https://github.com/alibaba/fastjson2/releases/tag/2.0.25 问题已修复,请用新版本
No branches or pull requests
问题描述
Boolean的get方法与is方法共存时无法预测会调用哪个方法
环境信息
重现步骤
以下测试用例能否通过不可预测
期待的正确结果
按照JavaBean约定,boolean对应方法以is开头,Boolean对应方法以get开头
建议忽略以is开头的Boolean方法,或明确指定这种情况下应该以哪个方法为优先
相关日志输出
附加信息
猜测获取FiledWriter时使用了并发扫描并进行了全局缓存,导致所有后续结果会以缓存结果为准
The text was updated successfully, but these errors were encountered: