Must-share information (formatted with Markdown):
- SonarQube Developer Edition v8.1 - Java
- Identify Executors Not Closed
- Searched Resources
I am quite new to Sonarqube and just installed a new version of Sonarqube to improve quality on an existing Java codebase. A bug occured in some older code in production where a Executor had not been closed in a method;
final ScheduledExecutorService autoAcknowledgementService = Executors.newSingleThreadScheduledExecutor(new ThreadFactory()
.......
autoAcknowledgementService.schedule(autoAcknowledgementRunnable, autoAcknowledgeDelay, TimeUnit.MILLISECONDS); //This line was not closed
We looked to see why this had not been picked up with SonarQube analysis and saw that the ‘Resources Should be Closed’ rule was looking for classes that implement the Closable or AutoCloseable interfaces.
Is there a way we can identify Executors that have not been closed?
Thanks