Dear Sonar team,
For a class extending ressource list bundle, it is expected to have the folowing class naming format:
name underscore locale ISO 639
Sonar trigger an issue doing that, ex
public class EulaContent_en extends ListResourceBundle results in Rename this class name to match the regular expression ‘[a-zA-Z0-9]*$’
Colin
(Colin)
November 10, 2022, 9:51am
2
Hey there.
Thanks for the feedback.
Please take a look at this post:
Hey SonarSource Community!
False-positives happen , as do false-negatives, and we’re eager to fix them. We are thrilled when our users report issues so that we can make our products better.
What is a false-positive (FP)?
A false-positive is when an issue is raised unexpectedly on code that should not trigger an issue, or where the suggested action doesn’t make any sense for the code.
What is a false-negative (FN)?
A false-negative is when an issue should be raised on a piece of code, but isn…
And provide some additional details – like what products/versions you’re using, and a code reproducer.
Hi, the Sonarqube version is community 9.5
A reproducible code is:
import java.util.ListResourceBundle;
public class Test_en extends ListResourceBundle {
@Override
protected Object[][] getContents() {
return new Object[0][];
}
}
The expected naming can be found here ListResourceBundle (Java Platform SE 8 )
Best regards,
Hi @Colin , do you need additional information to progress on that topic?
Thank you
Michael
(Michael Gumowski)
January 23, 2023, 6:25pm
8
Hey @yildiz-online ,
Thank you for your patience, it seems we forgot to get back to you about this one.
This is a fair point, classes extending ResourceBundle
are expected to contain underscores in their name to identify locales. Not handling this leads to raising False-Positives (FPs).
I created the following thicket to handle it: SONARJAVA-4405
Cheers,
Michael