FindBugs 报告了以下用于配置 Spring 安全性的构建器模式代码中的 and() 行的 Unchecked/Unconfirmed cast 问题。
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.inMemoryAuthentication()
.withUser("admin").password("secret").roles("ADMIN")
.and()
.withUser("user").password("secret").roles("USER");
}
代码运行良好,我该如何安抚 FindBugs?