File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed
src/main/java/com/smlnskgmail/jaman/checkstyle/checks Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 3333 language = ' java'
3434}
3535
36+ cpdCheck {
37+ exclude ' *.java'
38+ }
39+
3640repositories {
3741 mavenCentral()
3842}
Original file line number Diff line number Diff line change 77import java .util .Arrays ;
88import java .util .List ;
99
10+ @ SuppressWarnings ("CPD-START" )
1011public class MethodObjectReturnAnnotationCheck extends AbstractCheck {
1112
1213 private static final List <String > REQUIRED_ANNOTATIONS = Arrays .asList (
@@ -36,7 +37,8 @@ public void visitToken(DetailAST ast) {
3637 if (modifiers .getChildCount (TokenTypes .ANNOTATION ) == 0 ) {
3738 log (ast .getLineNo (), MESSAGE_KEY );
3839 } else {
39- if (!REQUIRED_ANNOTATIONS .contains (modifiers .getFirstChild ().findFirstToken (TokenTypes .IDENT ).getText ())) {
40+ String firstAnnotationName = modifiers .getFirstChild ().findFirstToken (TokenTypes .IDENT ).getText ();
41+ if (!REQUIRED_ANNOTATIONS .contains (firstAnnotationName )) {
4042 log (ast .getLineNo (), MESSAGE_KEY );
4143 }
4244 }
Original file line number Diff line number Diff line change 88import java .util .Arrays ;
99import java .util .List ;
1010
11+ @ SuppressWarnings ("CPD-START" )
1112public class MethodParametersAnnotationCheck extends AbstractCheck {
1213
1314 private static final List <String > REQUIRED_ANNOTATIONS = Arrays .asList (
You can’t perform that action at this time.
0 commit comments