1 /* 2 ParameterNumber 3 max = (default)7 4 ignoreOverriddenMethods = (default)false 5 tokens = (default)METHOD_DEF, CTOR_DEF 6 7 8 */ 9 10 package com.puppycrawl.tools.checkstyle.checks.sizes.parameternumber; 11 import java.io.*; 12 /** 13 * Contains simple mistakes: 14 * - Long lines 15 * - Tabs 16 * - Format of variables and parameters 17 * - Order of modifiers 18 * @author Oliver Burn 19 **/ 20 final class InputParameterNumberSimpleOne 21 { 22 // Long line ---------------------------------------------------------------- 23 // Contains a tab -> <- 24 // Contains trailing whitespace -> 25 26 // Name format tests 27 // 28 /** Invalid format **/ 29 public static final int badConstant = 2; 30 /** Valid format **/ 31 public static final int MAX_ROWS = 2; 32 33 /** Invalid format **/ 34 private static int badStatic = 2; 35 /** Valid format **/ 36 private static int sNumCreated = 0; 37 38 /** Invalid format **/ 39 private int badMember = 2; 40 /** Valid format **/ 41 private int mNumCreated1 = 0; 42 /** Valid format **/ 43 protected int mNumCreated2 = 0; 44 45 /** commas are wrong **/ 46 private int[] mInts = new int[] {1,2, 3, 47 4}; 48 49 // 50 // Accessor tests 51 // 52 /** should be private **/ 53 public static int sTest1; 54 /** should be private **/ 55 protected static int sTest3; 56 /** should be private **/ 57 static int sTest2; 58 59 /** should be private **/ 60 int mTest1; 61 /** should be private **/ 62 public int mTest2; 63 64 // 65 // Parameter name format tests 66 // 67 68 /** 69 * @return hack 70 * @param badFormat1 bad format 71 * @param badFormat2 bad format 72 * @param badFormat3 bad format 73 * @throws java.lang.Exception abc 74 **/ 75 int test1(int badFormat1,int badFormat2, 76 final int badFormat3) 77 throws java.lang.Exception 78 { 79 return 0; 80 } 81 82 /** method that is 20 lines long **/ 83 private void longMethod() 84 { 85 // a line 86 // a line 87 // a line 88 // a line 89 // a line 90 // a line 91 // a line 92 // a line 93 // a line 94 // a line 95 // a line 96 // a line 97 // a line 98 // a line 99 // a line 100 // a line 101 // a line 102 // a line 103 } 104 }