[java] CloseResource false-positive with URLClassLoader in cast expression #2056
Labels
a:false-positive
PMD flags a piece of code that is not problematic
has:pr
The issue is already tackled in a PR
Milestone
That one could be considered a FP, since we don't create the URLClassLoader here. We just cast the method argument, which is a ClassLoader, to a local variable, which is a URLClassLoader and therefore AutoCloseable...
_Originally posted by @adangel in #1955 _
Code example:
pmd/pmd-core/src/main/java/net/sourceforge/pmd/cache/AbstractAnalysisCache.java
Lines 117 to 127 in 5156e89
The variable "urlClassLoader" is not closed in this method and this is detected by the rule.
However, since the URLClassLoader is not created within this method, it should be ignored.
The text was updated successfully, but these errors were encountered: