1 /* 2 LineLength 3 fileExtensions = (default)"" 4 ignorePattern = ^.*is OK.*regexp.*$ 5 max = (default)80 6 7 8 */ 9 10 package com.puppycrawl.tools.checkstyle.checks.sizes.linelength; 11 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 public class InputLineLengthSimpleTwo { 21 /** method that is 20 lines long **/ 22 private void longMethod() 23 { 24 // a line 25 // a line 26 // a line 27 // a line 28 // a line 29 // a line 30 // a line 31 // a line 32 // a line 33 // a line 34 // a line 35 // a line 36 // a line 37 // a line 38 // a line 39 // a line 40 // a line 41 // a line 42 } 43 44 /** constructor that is 10 lines long **/ 45 private InputLineLengthSimpleTwo() 46 { 47 // a line 48 // a line 49 // a line 50 // a line 51 // a line 52 // a line 53 // a line 54 // a line 55 } 56 57 /** test local variables */ 58 private void localVariables() 59 { 60 // normal decl 61 int abc = 0; 62 int ABC = 0; 63 64 // final decls 65 final int cde = 0; 66 final int CDE = 0; 67 68 // decl in for loop init statement 69 for (int k = 0; k < 1; k++) 70 { 71 String innerBlockVariable = ""; 72 } 73 for (int I = 0; I < 1; I++) 74 { 75 String InnerBlockVariable = ""; 76 } 77 } 78 79 /** test method pattern */ 80 void ALL_UPPERCASE_METHOD() 81 { 82 } 83 84 /** test illegal constant **/ 85 private static final int BAD__NAME = 3; 86 87 // A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$" 88 // line has a tab -> <- and but OK if tab counted as 1 char // violation 89 // tabs that count as one char because of their position -> <- -> <-, OK 90 }