spring中反射工具类
安扫提示field.setAccessible(true)漏洞问题(java Spring)
采用 org.springframework.util.ReflectionUtils 反射工具类
TaskStatusUpdateFormVO formVO=new TaskStatusUpdateFormVO(); Field declaredField = formVO.getClass().getDeclaredField("address"); ReflectionUtils.makeAccessible(declaredField); ReflectionUtils.setField(declaredField,formVO,"123");
ReflectionUtils.makeAccessible(declaredField);代替 field.setAccessible(true)