alec
(Arnaud Lecointre)
1
Since SonarJava 5.14, and the new rule S5164 (SONARJAVA-3131).
Reproduction code :
class FpS5164
{
private static final ThreadLocal<String> TL = new ThreadLocal<>();
void clean()
{
FpS5164.TL.remove();
}
}
The false positive disappears by removing the class name from the remove call.
Quentin
(Quentin Jaquier)
2
Hello @alec, thanks for the feedback and the clear reproducer.
Indeed this is a wrong behavior of the rule, I created a ticket to track this issue.
Best,
Quentin
system
(system)
Closed
3
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.