View Javadoc
1   /*
2   LineLength
3   fileExtensions = (default)""
4   ignorePattern = ^.*is OK.*regexp.*$
5   max = (default)80
6   
7   
8   */
9   
10  package com.puppycrawl.tools.checkstyle.checks.sizes.linelength;
11  
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 public class InputLineLengthSimpleThree {
21      /** some lines to test the violation column after tabs */
22      void errorColumnAfterTabs()
23      {
24          // with tab-width 8 all statements below start at the same column,
25          // with different combinations of ' ' and '\t' before the statement
26          int tab0 =1;
27          int tab1 =1;
28          int tab2 =1;
29          int tab3 =1;
30          int tab4 =1;
31          int tab5 =1;
32      }
33  
34      // MEMME:
35      /* MEMME: a
36       * MEMME:
37       * OOOO
38       */
39      /* NOTHING */
40      /* YES */ /* MEMME: x */ /* YES!! */
41  
42      /** test long comments **/
43      void veryLong()
44      {
45          /*
46            blah blah blah blah
47            blah blah blah blah
48            blah blah blah blah
49            blah blah blah blah
50            blah blah blah blah
51            blah blah blah blah
52            blah blah blah blah
53            blah blah blah blah
54            blah blah blah blah
55            blah blah blah blah
56            blah blah blah blah
57            blah blah blah blah
58            blah blah blah blah
59            blah blah blah blah
60            blah blah blah blah
61            enough talk */
62      }
63  
64      /**
65       * @see to lazy to document all args. Testing excessive # args
66       **/
67      void toManyArgs(int aArg1, int aArg2, int aArg3, int aArg4, int aArg5,
68                      int aArg6, int aArg7, int aArg8, int aArg9)
69      {
70      }
71  }
72  
73  /** Test class for variable naming in for each clause. */
74  class InputLineLengthSimple2
75  {
76      /** Some more Javadoc. */
77      public void doSomething()
78      {
79          //"O" should be named "o"
80          for (Object O : new java.util.ArrayList())
81          {
82  
83          }
84      }
85  }
86  
87  /** Test enum for member naming check */
88  enum MyEnum1
89  {
90      /** ABC constant */
91      ABC,
92  
93      /** XYZ constant */
94      XYZ;
95  
96      /** Should be mSomeMember */
97      private int someMember;
98  }