1 /* // violation 2 TodoComment 3 format = FIXME: 4 5 6 */ 7 8 package com.puppycrawl.tools.checkstyle.checks.todocomment; 9 10 import java.io.*; 11 /** 12 * Contains simple mistakes: 13 * - Long lines 14 * - Tabs 15 * - Format of variables and parameters 16 * - Order of modifiers 17 * @author Oliver Burn 18 **/ 19 20 public class InputTodoCommentSimpleTwo { 21 /** test local variables */ 22 private void localVariables() 23 { 24 // normal decl 25 int abc = 0; 26 int ABC = 0; 27 28 // final decls 29 final int cde = 0; 30 final int CDE = 0; 31 32 // decl in for loop init statement 33 for (int k = 0; k < 1; k++) 34 { 35 String innerBlockVariable = ""; 36 } 37 for (int I = 0; I < 1; I++) 38 { 39 String InnerBlockVariable = ""; 40 } 41 } 42 43 /** test method pattern */ 44 void ALL_UPPERCASE_METHOD() 45 { 46 } 47 48 /** test illegal constant **/ 49 private static final int BAD__NAME = 3; 50 51 // A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$" 52 // long line that has a tab -> <- and would be OK if tab counted as 1 char 53 // tabs that count as one char because of their position -> <- -> <-, OK 54 55 /** some lines to test the violation column after tabs */ 56 void errorColumnAfterTabs() 57 { 58 // with tab-width 8 all statements below start at the same column, 59 // with different combinations of ' ' and '\t' before the statement 60 int tab0 =1; 61 int tab1 =1; 62 int tab2 =1; 63 int tab3 =1; 64 int tab4 =1; 65 int tab5 =1; 66 } 67 68 // FIXME: // violation 69 /* FIXME: a // violation 70 * FIXME: 71 * TODO 72 */ 73 /* NOTHING */ 74 /* YES */ /* FIXME: x */ /* YES!! */ // violation 75 76 /** test long comments **/ 77 void veryLong() 78 { 79 /* 80 blah blah blah blah 81 blah blah blah blah 82 blah blah blah blah 83 blah blah blah blah 84 blah blah blah blah 85 blah blah blah blah 86 blah blah blah blah 87 blah blah blah blah 88 blah blah blah blah 89 blah blah blah blah 90 blah blah blah blah 91 blah blah blah blah 92 blah blah blah blah 93 blah blah blah blah 94 blah blah blah blah 95 enough talk */ 96 } 97 98 /** 99 * @see to lazy to document all args. Testing excessive # args 100 **/ 101 void toManyArgs(int aArg1, int aArg2, int aArg3, int aArg4, int aArg5, 102 int aArg6, int aArg7, int aArg8, int aArg9) 103 { 104 } 105 } 106 107 /** Test class for variable naming in for each clause. */ 108 class InputTodoCommentSimple2 109 { 110 /** Some more Javadoc. */ 111 public void doSomething() 112 { 113 //"O" should be named "o" 114 for (Object O : new java.util.ArrayList()) 115 { 116 117 } 118 } 119 } 120