Java java:S101 for ListResourceBundle

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 ‘[1][a-zA-Z0-9]*$’


  1. A-Z ↩︎

Hey there.

Thanks for the feedback.

Please take a look at this post:

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

Hi @Colin any news?

Thank you.

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