View Javadoc
1   /*
2   FinalParameters
3   ignorePrimitiveTypes = (default)false
4   tokens = (default)METHOD_DEF, CTOR_DEF
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.finalparameters;
10  
11  public class InputFinalParametersPrimitiveTypes2
12  {
13      void foo(int i) {}  // violation, 'i' should be final
14      void foo1(int i, String k, float s) {}
15      // 3 violations above:
16      //    'Parameter i should be final.'
17      //    'Parameter k should be final.'
18      //    'Parameter s should be final.'
19      void foo2(String s, Object o, long l) {}
20      // 3 violations above:
21      //    'Parameter s should be final.'
22      //    'Parameter o should be final.'
23      //    'Parameter l should be final.'
24      void foo3(int[] array) {} // violation, 'array' should be final
25      void foo4(int i, float x, int[] s) {}
26      // 3 violations above:
27      //    'Parameter i should be final.'
28      //    'Parameter x should be final.'
29      //    'Parameter s should be final.'
30      void foo5(int x, long[] l, String s) {}
31      // 3 violations above:
32      //    'Parameter x should be final.'
33      //    'Parameter l should be final.'
34      //    'Parameter s should be final.'
35  }