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