View Javadoc
1   /*
2   LineLength
3   fileExtensions = (default)""
4   ignorePattern = ^.*is OK.*regexp.*$
5   max = (default)80
6   message.maxLineLen = {0},{1}
7   
8   
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.sizes.linelength;
12  
13  /**
14   * Contains simple mistakes:
15   * - Long lines
16   * - Tabs
17   * - Format of variables and parameters
18   * - Order of modifiers
19   * @author Oliver Burn
20   **/
21  final public class InputLineLengthSimple1Two {
22      /** method that is 20 lines long **/
23      private void longMethod()
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          // 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          // a line
43      }
44  
45      /** constructor that is 10 lines long **/
46      private InputLineLengthSimple1Two()
47      {
48          // a line
49          // a line
50          // a line
51          // a line
52          // a line
53          // a line
54          // a line
55          // a line
56      }
57  
58      /** test local variables */
59      private void localVariables()
60      {
61          // normal decl
62          int abc = 0;
63          int ABC = 0;
64  
65          // final decls
66          final int cde = 0;
67          final int CDE = 0;
68  
69          // decl in for loop init statement
70          for (int k = 0; k < 1; k++)
71          {
72              String innerBlockVariable = "";
73          }
74          for (int I = 0; I < 1; I++)
75          {
76              String InnerBlockVariable = "";
77          }
78      }
79  
80      /** test method pattern */
81      void ALL_UPPERCASE_METHOD()
82      {
83      }
84  
85      /** test illegal constant **/
86      private static final int BAD__NAME = 3;
87  
88      // A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$"
89      // line has a tab ->	<- and but OK if tab counted as 1 char // violation
90      // tabs that count as one char because of their position ->	<-   ->	<-, OK
91  }