Hi
I am using the Java plugin version 3.13.1.
The following code will result in a blocker issue:
@SpringBootApplication
public class App extends SpringBootServletInitializer {
public static void main(final String[] args) {
SpringApplication.run(App.class, args);
}
}
The Sonar Java plugin tells me to close the ConfigurableApplicationContex (squid:S2095) however if I do that then the application will stop as soon as it has finished starting so I consider this a false positive (with dangerous side effects!). If someone did close the ConfigurableApplicationContex it would only be apparent when running the application using the embedded Tomcat server, the deployable war file is unaffected.
I think Spring Boot is fairly widely used so I'm sure this issue is effecting several people.
Incidentally the Sonar Java plugin also suggests closing an IntStream (Java 8) which although probably not harmful it is unnecessary. This is also (squid:S2095).
Many Thanks.