We are using Sonarqube 9.6
The following code produces a false positive for rule java:S1213
public record Fraction(String numerator, String denominator) {
public static final RoundingMode ROUNDING_MODE = RoundingMode.HALF_UP;
// Move this static variable to comply with Java Code Conventions.
public static final int DECIMAL_SCALE = 10;
// Move this static variable to comply with Java Code Conventions.
public Fraction {
Objects.requireNonNull(numerator);
Objects.requireNonNull(denominator);
}
}
I’m not sure if its irritated by the extra constructor in the record.
Kind regards,
Michael