java:S1172 marks records with unused parameters

SonarQube Community Version 8.8 (build 42792)

A plain inner record declaration gets flagged with java:S1172

private record DataKey(String primaryKey, String secondaryKey) {}

The record is used as key in a map so the record itself is not unused and neither is the constructor.

I currently see no reason to mark records at all with java:S1172.

Hello @copy,

Thanks for your post. Currently, SQ is not supporting Java 16 features properly. This leads to a certain amount of False Positives and False Negatives.

Your case will be covered once this ticket is implemented. This can be done sometime in the summer (there is a dependency on the Eclipse compiler)

Regars,
Margarita

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.