0
In my class in the method findRecursosMensagem() Sonarqube makes a criticism, but I did not understand what should be corrected. Could help me understand what must be done?
public class LoginController extends AbstractController implements AuthenticationProvider, Serializable {
private static final long serialVersionUID = 1L;
private Connector connector;
@Resource(name = "messageSource")
protected MessageSource messageSource;
@Inject
private IntegracaoService integracaoService;
@RequestMapping(method = RequestMethod.GET)
public ModelAndView index() {
return new ModelAndView("login");
}
@ResponseBody
@RequestMapping(value = "/logar", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public Autenticacao logar(@RequestBody AutenticacaoDMN autenticacao, HttpServletRequest request){
request.getSession().invalidate();
autenticacao.setSistema(SISTEMA);
Autenticacao autenticacaoRetorno = integracaoService.login(autenticacao);
if (autenticacaoRetorno.isAutenticado()) {
autenticacao.setIdUsuario(autenticacaoRetorno.getIdUsuario());
integracaoService.setUserAutenticate(autenticacao, request);
}
return autenticacaoRetorno;
}
private List<Map<String, Object>> findRecursosMensagem(){
Map<String, Object> args = new HashMap<>();
args.put("chave", "MensagemCovid");
List<Map<String, Object>> mensagem = null;
mensagem = connector.findServicoReturnList(args, "lms.radar.usuarioFacade.findRecursosMensagem");
return mensagem;
}
}
Sonar always has an explanation. Click on
See Rule
, that he explains to you– Leonardo Alves Machado