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