Skip to content

Commit

Permalink
ignore setter methods that are not really setter
Browse files Browse the repository at this point in the history
  • Loading branch information
Luro02 committed Apr 2, 2024
1 parent eead254 commit 7194c45
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private <T> void checkCtMethod(CtMethod<T> ctMethod) {
return;
}

if (prefix.equals("set") && isInvalidSetterReturnType(ctMethod)) {
if (prefix.equals("set") && isInvalidSetterReturnType(ctMethod) && SpoonUtil.getEffectiveStatements(ctMethod.getBody()).size() <= 3) {
// it is expected that a setter returns nothing (void)
this.reportProblem(
"linguistic-naming-setter",
Expand Down

0 comments on commit 7194c45

Please sign in to comment.