1 /* 2 MethodLength 3 max = 19 4 countEmpty = false 5 tokens = (default)METHOD_DEF , CTOR_DEF , COMPACT_CTOR_DEF 6 7 */ 8 9 package com.puppycrawl.tools.checkstyle.checks.sizes.methodlength; 10 import java.io.*; 11 final class InputMethodLengthCountEmptyIsFalse 12 { 13 // Long line ---------------------------------------------------------------- 14 // Contains a tab -> <- 15 // Contains trailing whitespace -> 16 17 // Name format tests 18 // 19 /** Invalid format **/ 20 public static final int badConstant = 2; 21 /** Valid format **/ 22 public static final int MAX_ROWS = 2; 23 24 /** Invalid format **/ 25 private static int badStatic = 2; 26 /** Valid format **/ 27 private static int sNumCreated = 0; 28 29 /** Invalid format **/ 30 private int badMember = 2; 31 /** Valid format **/ 32 private int mNumCreated1 = 0; 33 /** Valid format **/ 34 protected int mNumCreated2 = 0; 35 36 /** commas are wrong **/ 37 private int[] mInts = new int[] {1,2, 3, 38 4}; 39 40 // 41 // Accessor tests 42 // 43 /** should be private **/ 44 public static int sTest1; 45 /** should be private **/ 46 protected static int sTest3; 47 /** should be private **/ 48 static int sTest2; 49 50 /** should be private **/ 51 int mTest1; 52 /** should be private **/ 53 public int mTest2; 54 55 // 56 // Parameter name format tests 57 // 58 59 /** 60 * @return hack 61 * @param badFormat1 bad format 62 * @param badFormat2 bad format 63 * @param badFormat3 bad format 64 * @throws java.lang.Exception abc 65 **/ 66 int test1(int badFormat1,int badFormat2, 67 final int badFormat3) 68 throws java.lang.Exception 69 { 70 return 0; 71 } 72 73 /** method that is 20 lines long **/ 74 private void longMethod() 75 { 76 // a line 77 // a line 78 // a line 79 // a line 80 // a line 81 // a line 82 // a line 83 // a line 84 // a line 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 95 } 96 }