lbenedetto
(Lars Benedetto)
1
var myMutableList = blah.stream()
.collect(Collectors.toList());
Collections.shuffle(myMutableList);
Sonar complains that I should use toList() instead, but shuffle requires that the list be mutable.
SonarSource 7.1.1.54565
SonarQube 9.6.0.59041
Java 17.0.4
Colin
(Colin)
2
Hey there.
Thanks for the feedback!
Please take a look at this thread:
We’re missing some important information (like what product(s) you’re using, and which version if relevant).
lbenedetto
(Lars Benedetto)
3
SonarLint 7.1.1.54565
SonarQube 9.6.0.59041
Java 17.0.4
Hello @lbenedetto,
Thanks for your message and sorry for such a late reply. I was able to reproduce your issue and I confirm it’s a False-positive.
Here is the ticket to fix it:
https://sonarsource.atlassian.net/browse/SONARJAVA-4372
Regards,
Margarita
system
(system)
Closed
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.