View Javadoc
1   /*
2   MethodLength
3   max = 19
4   countEmpty = false
5   tokens = (default)METHOD_DEF , CTOR_DEF , COMPACT_CTOR_DEF
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.sizes.methodlength;
10  import java.io.*;
11  final class InputMethodLengthCountEmptyIsFalseTwo
12  {
13      /** constructor that is 10 lines long **/
14      private InputMethodLengthCountEmptyIsFalseTwo()
15      {
16          // a line
17          // a line
18          // a line
19          // a line
20          // a line
21          // a line
22          // a line
23          // a line
24      }
25  
26      /** test local variables */
27      private void localVariables()
28      {
29          // normal decl
30          int abc = 0;
31          int ABC = 0;
32  
33          // final decls
34          final int cde = 0;
35          final int CDE = 0;
36  
37          // decl in for loop init statement
38          for (int k = 0; k < 1; k++)
39          {
40              String innerBlockVariable = "";
41          }
42          for (int I = 0; I < 1; I++)
43          {
44              String InnerBlockVariable = "";
45          }
46      }
47  
48      /** test method pattern */
49      void ALL_UPPERCASE_METHOD()
50      {
51      }
52  
53      /** test illegal constant **/
54      private static final int BAD__NAME = 3;
55  
56      // A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$"
57      // long line that has a tab ->        <- and would be OK if tab counted as 1 char
58      // tabs that count as one char because of their position ->        <-   ->        <-, OK
59  
60      /** some lines to test the violation column after tabs */
61      void errorColumnAfterTabs()
62      {
63          // with tab-width 8 all statements below start at the same column,
64          // with different combinations of ' ' and '\t' before the statement
65                  int tab0 =1;
66                  int tab1 =1;
67                   int tab2 =1;
68                  int tab3 =1;
69                      int tab4 =1;
70                    int tab5 =1;
71      }
72  
73      // MEMME:
74      /* MEMME: a
75       * MEMME:
76       * OOOO
77       */
78      /* NOTHING */
79      /* YES */ /* MEMME: x */ /* YES!! */
80  
81      /** test long comments **/
82      void veryLong()
83      {
84          /*
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            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           enough talk */
101     }
102 
103     /**
104      * @see to lazy to document all args. Testing excessive # args
105      **/
106     void toManyArgs(int aArg1, int aArg2, int aArg3, int aArg4, int aArg5,
107                     int aArg6, int aArg7, int aArg8, int aArg9)
108     {
109     }
110 
111 }