View Javadoc
1   package com.google.checkstyle.test.chapter2filebasic.rule231filetab;
2   
3   final class InputFormattedWhitespaceCharacters {
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 Exception abc
16     */
17    int test1(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
18      return 0;
19    }
20  
21    // A very, very long line that is OK because it matches the regexp "^.*is OK.*regexp.*$"
22    // long line that has a tab ->	<- and would be OK if tab counted as 1 char
23    // violation above 'Line contains a tab character.'
24  
25    // tabs that count as one char because of their position ->	<-   ->	<-
26    // violation above 'Line contains a tab character.'
27  
28    /** some lines to test the column after tabs. */
29    void violateColumnAfterTabs() {
30      // with tab-width 8 all statements below start at the same column,
31      // with different combinations of ' ' and '\t' before the statement
32      int tab0 = 1;
33      int tab1 = 1;
34      int tab2 = 1;
35      int tab3 = 1;
36      int tab4 = 1;
37      int tab5 = 1;
38    }
39  }