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