1 /* // violation 2 TodoComment 3 format = FIXME: 4 5 6 */ 7 8 package com.puppycrawl.tools.checkstyle.checks.todocomment; 9 10 /** 11 * Contains simple mistakes: 12 * - Long lines 13 * - Format of variables and parameters 14 * - Order of modifiers 15 * @author Oliver Burn 16 **/ 17 final class InputTodoCommentSimpleOne 18 { 19 // Long line ---------------------------------------------------------------- 20 // Contains trailing whitespace -> 21 // Name format tests 22 // 23 /** Invalid format **/ 24 public static final int badConstant = 2; 25 /** Valid format **/ 26 public static final int MAX_ROWS = 2; 27 /** Invalid format **/ 28 private static int badStatic = 2; 29 /** Valid format **/ 30 private static int sNumCreated = 0; 31 /** Invalid format **/ 32 private int badMember = 2; 33 /** Valid format **/ 34 private int mNumCreated1 = 0; 35 /** Valid format **/ 36 protected int mNumCreated2 = 0; 37 /** commas are wrong **/ 38 private int[] mInts = new int[] {1,2, 3, 39 4}; 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 * @return hack 60 * @param badFormat1 bad format 61 * @param badFormat2 bad format 62 * @param badFormat3 bad format 63 * @throws java.lang.Exception abc 64 **/ 65 int test1(int badFormat1,int badFormat2, 66 final int badFormat3) 67 throws java.lang.Exception 68 { 69 return 0; 70 } 71 /** method that is 20 lines long **/ 72 private void longMethod() 73 { 74 // a line 75 // a line 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 } 93 /** constructor that is 10 lines long **/ 94 private InputTodoCommentSimpleOne() 95 { 96 // a line 97 // a line 98 // a line 99 // a line 100 // a line 101 // a line 102 // a line 103 // a line 104 } 105 } 106 /** Test enum for member naming check */ 107 enum MyEnum1 108 { 109 /** ABC constant */ 110 ABC, 111 /** XYZ constant */ 112 XYZ; 113 /** Should be mSomeMember */ 114 private int someMember; 115 public final int blah = 5; 116 }