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 InputLineLengthSimple1Three {
22      /** some lines to test the violation column after tabs */
23      void errorColumnAfterTabs()
24      {
25          // with tab-width 8 all statements below start at the same column,
26          // with different combinations of ' ' and '\t' before the statement
27          int tab0 =1;
28          int tab1 =1;
29          int tab2 =1;
30          int tab3 =1;
31          int tab4 =1;
32          int tab5 =1;
33      }
34  
35      // MEMME:
36      /* MEMME: a
37       * MEMME:
38       * OOOO
39       */
40      /* NOTHING */
41      /* YES */ /* MEMME: x */ /* YES!! */
42  
43      /** test long comments **/
44      void veryLong()
45      {
46          /*
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            blah blah blah blah
62            enough talk */
63      }
64  
65      /**
66       * @see to lazy to document all args. Testing excessive # args
67       **/
68      void toManyArgs(int aArg1, int aArg2, int aArg3, int aArg4, int aArg5,
69                      int aArg6, int aArg7, int aArg8, int aArg9)
70      {
71      }
72  }
73  
74  /** Test class for variable naming in for each clause. */
75  class InputLineLengthSimple3
76  {
77      /** Some more Javadoc. */
78      public void doSomething()
79      {
80          //"O" should be named "o"
81          for (Object O : new java.util.ArrayList())
82          {
83  
84          }
85      }
86  }
87  
88  /** Test enum for member naming check */
89  enum MyEnum2
90  {
91      /** ABC constant */
92      ABC,
93  
94      /** XYZ constant */
95      XYZ;
96  
97      /** Should be mSomeMember */
98      private int someMember;
99  }