SONARJAVA-5985 Improve S6207's logic for constructors#5512
SONARJAVA-5985 Improve S6207's logic for constructors#5512aurelien-coet-sonarsource merged 4 commits intomasterfrom
Conversation
There was a problem hiding this comment.
- IIUC, we are currently give up to apply the rule in cases like
record Record(String name) {
Record(String name, String alias) {
//some logic with name / alias
this(name);
}
}
Is it intentional? Do we plan to improve it in the future?
- Don't forget to update RSpec (we change messages for this rule).
java-checks/src/main/java/org/sonar/java/checks/RedundantRecordMethodsCheck.java
Outdated
Show resolved
Hide resolved
Yes, it is intentional because we only want to raise an issue on the exact equivalent of a default constructor. Here the custom constructor doesn't match the default one because it has two parameters instead of only one for There is nothing to update in RSpec because it doesn't include the messages that are raised for the issue, and the description already matches the behaviour implemented here (the previous implementation actually didn't match RSpec). |
|




No description provided.