View Javadoc
1   package com.google.checkstyle.test.chapter2filebasic.rule231filetab;
2   
3   final class InputWhitespaceCharacters {
4     // Long line ----------------------------------------------------------------
5     // Contains a tab ->	<- // violation 'Line contains a tab character.'
6     // Contains trailing whitespace ->
7   
8     /**
9      * Some javadoc.
10     *
11     * @param badFormat1 bad format
12     * @param badFormat2 bad format
13     * @param badFormat3 bad format
14     * @return hack
15     * @throws java.lang.Exception abc
16     **/
17    int test1(int badFormat1, int badFormat2,
18    		final int badFormat3) // violation 'Line contains a tab character.'
19        throws java.lang.Exception {
20      return 0;
21    }
22  
23    // A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$"
24    // long line that has a tab ->	<- and would be OK if tab counted as 1 char
25    // violation above 'Line contains a tab character.'
26    // tabs that count as one char because of their position ->	<-   ->	<-
27    // violation above 'Line contains a tab character.'
28  
29    /** some lines to test the column after tabs. */
30    void violateColumnAfterTabs() {
31      // with tab-width 8 all statements below start at the same column,
32      // with different combinations of ' ' and '\t' before the statement
33      int tab0 = 1;
34    	int tab1 = 1;
35     // 2 violations above:
36     //  'Line contains a tab character.'
37     //  ''method def' child has incorrect indentation level 8, expected level should be 4.'
38    	int tab2 = 1;
39    // 2 violations above:
40    //  'Line contains a tab character.'
41    //  ''method def' child has incorrect indentation level 8, expected level should be 4.'
42  		int tab3 = 1;
43      // 2 violations above:
44      //  'Line contains a tab character.'
45      //  ''method def' child has incorrect indentation level 16, expected level should be 4.'
46   	 	int tab4 = 1;
47     // 2 violations above:
48     //  'Line contains a tab character.'
49     //  ''method def' child has incorrect indentation level 16, expected level should be 4.'
50    	int tab5 = 1;
51     // 2 violations above:
52     //  'Line contains a tab character.'
53     //  ''method def' child has incorrect indentation level 8, expected level should be 4.'
54    }
55  }