Missing release of resources rule Medium

Resources that implement AutoCloseable or require explicit closure must be properly managed throughout their lifecycle. The recommended approach is to use try-with-resources block which ensures automatic and safe resource closure, regardless of whether an exception occurs or not. Failing to properly close resources can lead to resource leaks, memory issues, and system instability. This applies to both application resources and testing components.

Detector ID
java/missing-release-of-resources-rule@v1.0
Category
Common Weakness Enumeration (CWE) external icon