[JAVA] S2386 Mutable fields should not be "public static" - False Positive - singleton collection created by java.util.Collections are unmodifiable

393 views
Skip to first unread message

Adam Gabryś

unread,
Mar 5, 2018, 10:25:14 AM3/5/18
to SonarQube

Hello,

The S2386 rule doesn't know that singleton collections created by java.util.Collections are unmodifiable:




Environment:


Regards

Adam Gabryś


Michael Gumowski

unread,
Mar 6, 2018, 4:57:12 AM3/6/18
to Adam Gabryś, SonarQube
Hey Adam,

Thanks for the feedback and reproducer.
These are indeed 3 nice FPs, which are going to be handled by the following ticket: SONARJAVA-2660

Cheers,
Michael

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/DB6PR0801MB1287EF490B7ACECE1FA041A198DA0%40DB6PR0801MB1287.eurprd08.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.
--
Michael Gumowski | SonarSource
Software Developer, Language Team
https://www.sonarsource.com
Reply all
Reply to author
Forward
0 new messages