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 InputParameterNumberSimpleTwo 21 { 22 /** constructor that is 10 lines long **/ 23 private InputParameterNumberSimpleTwo() 24 { 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 } 34 35 /** test local variables */ 36 private void localVariables() 37 { 38 // normal decl 39 int abc = 0; 40 int ABC = 0; 41 42 // final decls 43 final int cde = 0; 44 final int CDE = 0; 45 46 // decl in for loop init statement 47 for (int k = 0; k < 1; k++) 48 { 49 String innerBlockVariable = ""; 50 } 51 for (int I = 0; I < 1; I++) 52 { 53 String InnerBlockVariable = ""; 54 } 55 } 56 57 /** test method pattern */ 58 void ALL_UPPERCASE_METHOD() 59 { 60 } 61 62 /** test illegal constant **/ 63 private static final int BAD__NAME = 3; 64 65 // A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$" 66 // long line that has a tab -> <- and would be OK if tab counted as 1 char 67 // tabs that count as one char because of their position -> <- -> <-, OK 68 69 /** some lines to test the violation column after tabs */ 70 void errorColumnAfterTabs() 71 { 72 // with tab-width 8 all statements below start at the same column, 73 // with different combinations of ' ' and '\t' before the statement 74 int tab0 =1; 75 int tab1 =1; 76 int tab2 =1; 77 int tab3 =1; 78 int tab4 =1; 79 int tab5 =1; 80 } 81 82 // MEMME: 83 /* MEMME: a 84 * MEMME: 85 * OOOO 86 */ 87 /* NOTHING */ 88 /* YES */ /* MEMME: x */ /* YES!! */ 89 }