View Javadoc
1   /*
2   FileLength
3   
4   
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.sizes.filelength;
10  
11  /**
12   * Contains simple mistakes:
13   * - Long lines
14   * - Tabs
15   * - Format of variables and parameters
16   * - Order of modifiers
17   * @author Oliver Burn
18   **/
19  final class InputFileLengthDefault
20  {
21      // Long line ----------------------------------------------------------------
22      // Contains a tab ->        <-
23      // Contains trailing whitespace ->
24  
25      // Name format tests
26      //
27      /** Invalid format **/
28      public static final int badConstant = 2;
29      /** Valid format **/
30      public static final int MAX_ROWS = 2;
31  
32      /** Invalid format **/
33      private static int badStatic = 2;
34      /** Valid format **/
35      private static int sNumCreated = 0;
36  
37      /** Invalid format **/
38      private int badMember = 2;
39      /** Valid format **/
40      private int mNumCreated1 = 0;
41      /** Valid format **/
42      protected int mNumCreated2 = 0;
43  
44      /** commas are wrong **/
45      private int[] mInts = new int[] {1,2, 3,
46                                       4};
47  
48      //
49      // Accessor tests
50      //
51      /** should be private **/
52      public static int sTest1;
53      /** should be private **/
54      protected static int sTest3;
55      /** should be private **/
56      static int sTest2;
57  
58      /** should be private **/
59      int mTest1;
60      /** should be private **/
61      public int mTest2;
62  
63      //
64      // Parameter name format tests
65      //
66  
67      /**
68       * @return hack
69       * @param badFormat1 bad format
70       * @param badFormat2 bad format
71       * @param badFormat3 bad format
72       * @throws Exception abc
73       **/
74      int test1(int badFormat1,int badFormat2,
75                final int badFormat3)
76          throws Exception
77      {
78          return 0;
79      }
80  
81      /** method that is 20 lines long **/
82      private void longMethod()
83      {
84          // a line
85          // a line
86          // a line
87          // a line
88          // a line
89          // a line
90          // a line
91          // a line
92          // a line
93          // a line
94          // a line
95          // a line
96          // a line
97          // a line
98          // a line
99          // a line
100         // a line
101         // a line
102     }
103 
104     /** constructor that is 10 lines long **/
105     private InputFileLengthDefault()
106     {
107         // a line
108         // a line
109         // a line
110         // a line
111         // a line
112         // a line
113         // a line
114         // a line
115     }
116 }