View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule452indentcontinuationlines;
2   
3   /** some javadoc. */
4   public abstract class InputIndentationCorrect {
5   
6     static int i;
7   
8     static {
9       i = 0;
10    }
11  
12    int[] pqr = {
13      1, 2, 3,
14      4, 5, 6
15    };
16    int abc;
17  
18    {
19      abc = 2;
20    }
21  
22    /** some javadoc. */
23    public boolean matches(char c) {
24      return false;
25    }
26  
27    /** some javadoc. */
28    public void foo() {
29      int i = 0;
30      for (; i < 9; i++) {
31        if (veryLongLongLongCondition() || veryLongLongLongCondition2()) {
32          someFooMethod("longString", "veryLongString", "superVeryExtraLongString");
33          if (veryLongLongLongCondition()) {
34            while (veryLongLongLongCondition2() && veryLongLongLongCondition2()) {
35              try {
36                doSmth();
37              } catch (Exception e) {
38                throw new AssertionError(e);
39              }
40            }
41          }
42        }
43      }
44    }
45  
46    /** some javadoc. */
47    public boolean veryLongLongLongCondition() {
48      return veryLongLongLongCondition2();
49    }
50  
51    /** some javadoc. */
52    public boolean veryLongLongLongCondition2() {
53      return false;
54    }
55  
56    /** some javadoc. */
57    public void someFooMethod(
58        String longString, String superLongString, String exraSuperLongString) {}
59  
60    /** some javadoc. */
61    public void fooThrowMethod() throws Exception {
62      /* Some code*/
63    }
64  
65    /** some javadoc. */
66    public void doSmth() {
67      for (int h : pqr) {
68        someFooMethod("longString", "veryLongString", "superVeryExtraLongString");
69      }
70    }
71  
72    private abstract static class RangesMatcher {
73  
74      public static final InputIndentationCorrect JAVA_LETTER_OR_DIGIT =
75          new InputIndentationCorrect() {
76            @Override
77            public boolean matches(char c) {
78              return Character.isLetterOrDigit(c);
79            }
80          };
81  
82      /** Matches no characters. */
83      public static final InputFastMatcher NONE =
84          new InputFastMatcher() {
85            @Override
86            public boolean matches(char c) {
87              return false;
88            }
89  
90            @Override
91            public String replaceFrom(CharSequence seq, CharSequence repl) {
92              checkNotNull(repl);
93              return seq.toString();
94            }
95  
96            private void checkNotNull(CharSequence replacement) {}
97  
98            @Override
99            public String collapseFrom(CharSequence sequence, char replacement) {
100             return sequence.toString();
101           }
102 
103           @Override
104           public String trimTrailingFrom(CharSequence sequence) {
105             return sequence.toString();
106           }
107         };
108 
109     private static final String ZEROES = "" + "";
110   }
111 }