orimarko
(ori marko)
1
I’m auto-wiring Spring bean in Servlets, SonarQube is warning that “all servlet fields should then be either static and/or final”
But it similar false positive as SONARJAVA-2744 which was Java’s @Inject
Code:
public class MyServlet extends HttpServlet {
@Autowire
private MySpringBean mySpringBean;
}
saberduck
(Tibor Blenessy)
2
Indeed the issue should not be raised on such field same way as it is not raised on field annotated with @Inject, @Resource or @EJB.
I created an issue to fix this https://jira.sonarsource.com/browse/SONARJAVA-2895
1 Like
system
(system)
Closed
3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.