sonar扫描的修复记录

 

1、SonarLint: This accessibility update should be removed.

field.setAccessible(true);

修复:可以使用反射工具类ReflectionUtils.makeAccessible替换

eg: ReflectionUtils.makeAccessible(field);

 


 

2、This accessibility bypass should be removed.

field.set(obj, value);

修复:使用 ReflectionUtils.setField替换

ReflectionUtils.setField(field,obj,value);

 


 

posted @   aaacarrot  阅读(2238)  评论(1编辑  收藏  举报
相关博文:
阅读排行:
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
点击右上角即可分享
微信分享提示