View Javadoc
1   /*
2   RedundantModifier
3   tokens = (default)METHOD_DEF, VARIABLE_DEF, ANNOTATION_FIELD_DEF, INTERFACE_DEF, \
4            CTOR_DEF, CLASS_DEF, ENUM_DEF, RESOURCE
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.modifier.redundantmodifier;
10  
11  
12  public interface InputRedundantModifierFinalInInterface {
13          final int k = 5; // violation
14  
15      default int defaultMethod(final int x) {
16              if (k == 5) {
17                      final int t = 24;  //No violation here!
18                      for (; ;) {
19                              final String s = "some";  //No violation here!
20                      }
21              }
22          final int square = x * x;  //No violation here!
23          return square;
24      }
25  }