View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule4841indentation; //indent:0 exp:0
2   
3   class InputIndentationCorrectReturnAndParameter { //indent:0 exp:0
4   
5     String getString(int someInt, String someString) { //indent:2 exp:2
6       return "String"; //indent:4 exp:4
7     } //indent:2 exp:2
8   
9     boolean fooMethodWithIf() { //indent:2 exp:2
10  
11      return conditionSecond(10000000000.0, new //indent:4 exp:4
12          SecondClassLongName("Looooooooooooo" //indent:8 exp:8
13          + "oooooooooooong").getString(new FooReturnClass(), //indent:8 exp:8
14            new SecondClassLongName("loooooooooong"). //indent:10 exp:10
15          getInteger(new FooReturnClass(), "loooooooooooooong")), "loooooooooooong") //indent:8 exp:8
16          || conditionThird(2048) || conditionFourth(new //indent:8 exp:8
17          SecondClassLongName("Looooooooooooooo" //indent:8 exp:8
18          + "ooooooooooooong").getBoolean(new FooReturnClass(), false)) || //indent:8 exp:8
19          conditionFifth(true, new SecondClassLongName(getString(2048, "Looo" //indent:8 exp:8
20          + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean( //indent:8 exp:8
21            new FooReturnClass(), true)) || conditionSixth(false, new //indent:10 exp:10
22            SecondClassLongName(getString(100000, "Loooooong" //indent:10 exp:10
23          + "Fooooooo><"))) || conditionNoArg() //indent:8 exp:8
24          || conditionNoArg() || //indent:8 exp:8
25          conditionNoArg() || conditionNoArg();//indent:8 exp:8
26    } //indent:2 exp:2
27  
28    private boolean conditionFirst(String longString, int //indent:2 exp:2
29        integer, InnerClassFoo someInstance) { //indent:6 exp:6
30      return false; //indent:4 exp:4
31    } //indent:2 exp:2
32  
33    private boolean conditionSecond(double longLongLongDoubleValue, //indent:2 exp:2
34        String longLongLongString, String secondLongLongString) { //indent:6 exp:6
35      return false; //indent:4 exp:4
36    } //indent:2 exp:2
37  
38    private boolean conditionThird(long veryLongValue) { //indent:2 exp:2
39      return false; //indent:4 exp:4
40    } //indent:2 exp:2
41  
42    private boolean conditionFourth(boolean flag) { //indent:2 exp:2
43      return false; //indent:4 exp:4
44    } //indent:2 exp:2
45  
46    private boolean conditionFifth(boolean flag1, boolean flag2) { //indent:2 exp:2
47      return false; //indent:4 exp:4
48    } //indent:2 exp:2
49  
50    private boolean conditionSixth(boolean flag, //indent:2 exp:2
51        SecondClassLongName instance) { //indent:6 exp:6
52      return false; //indent:4 exp:4
53    } //indent:2 exp:2
54  
55    private boolean conditionNoArg() { //indent:2 exp:2
56      return false; //indent:4 exp:4
57    } //indent:2 exp:2
58  
59    class InnerClassFoo { //indent:2 exp:2
60  
61      boolean fooMethodWithIf() { //indent:4 exp:4
62        return conditionFirst("Loooooooooooooooooong", new //indent:6 exp:6
63            SecondClassLongName("Loooooooooooooooooog"). //indent:10 exp:10
64                getInteger(new FooReturnClass(), "Loooooooooooooooooog"), //indent:14 exp:>=10
65                new InnerClassFoo()); //indent:14 exp:>=10
66      } //indent:4 exp:4
67  
68      boolean fooReturn() { //indent:4 exp:4
69        return conditionSecond(10000000000.0, new //indent:6 exp:6
70            SecondClassLongName("Looooooooooooo" //indent:10 exp:10
71            + "oooooooooooong").getString(new FooReturnClass(), //indent:10 exp:10
72              new SecondClassLongName("loooooooooong"). //indent:12 exp:12
73            getInteger(new FooReturnClass(), "looooooooooong")), "loooooooooooong") //indent:10 exp:10
74            || conditionThird(2048) || conditionFourth(new //indent:10 exp:10
75            SecondClassLongName("Looooooooooooooo" //indent:10 exp:10
76              + "ooooooooooooong").getBoolean(new FooReturnClass(), false)) || //indent:12 exp:>=10
77              conditionFifth(true, new SecondClassLongName(getString(2048, "Looo" //indent:12 exp:>=10
78              + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean( //indent:12 exp:>=10
79                new FooReturnClass(), true)) || conditionSixth(false, new //indent:14 exp:>=14
80                SecondClassLongName(getString(100000, "Loooooong" //indent:14 exp:>=10
81                + "Fooooooo><"))) || conditionNoArg() //indent:14 exp:>=10
82                || conditionNoArg() || //indent:14 exp:>=10
83                conditionNoArg() || conditionNoArg(); //indent:14 exp:>=10
84      } //indent:4 exp:4
85  
86      FooReturnClass anonymousClass = new FooReturnClass() { //indent:4 exp:4
87  
88        boolean fooMethodWithIf(String stringStringStringStringLooooongString, //indent:6 exp:6
89            int intIntIntVeryLongNameForIntVariable, boolean //indent:10 exp:10
90                fooooooooobooleanBooleanVeryLongName) { //indent:14 exp:>=10
91  
92          return conditionSecond(10000000000.0, new //indent:8 exp:8
93              SecondClassLongName("Looooooooooooo" //indent:12 exp:12
94              + "oooooooooooong").getString(new FooReturnClass(), //indent:12 exp:12
95                new SecondClassLongName("loooooooooong"). //indent:14 exp:14
96              getInteger(new FooReturnClass(), "looooooooong")), "loooooooooooong") //indent:12 exp:12
97              || conditionThird(2048) || conditionFourth(new //indent:12 exp:12
98              SecondClassLongName("Looooooooooooooo" //indent:12 exp:12
99                + "ooooooooooooong").getBoolean(new FooReturnClass(), false)) || //indent:14 exp:>=12
100               conditionFifth(true, new SecondClassLongName(getString(2048, "Lo" //indent:14 exp:>=12
101               + "ooooooooooooooooooooooooooooooooooooooooooong")).getBoolean( //indent:14 exp:>=12
102                 new FooReturnClass(), true)) || conditionSixth(false, new //indent:16 exp:>=16
103                 SecondClassLongName(getString(100000, "Loooooong" //indent:16 exp:>=12
104                 + "Fooooooo><"))) || conditionNoArg() //indent:16 exp:>=12
105                 || conditionNoArg() || //indent:16 exp:>=12
106                   conditionNoArg() || conditionNoArg() //indent:18 exp:>=12
107                      && fooooooooobooleanBooleanVeryLongName; //indent:21 exp:>=12
108       } //indent:6 exp:6
109 
110       boolean fooReturn() { //indent:6 exp:6
111         return conditionFirst("Loooooooooooooooooong", new //indent:8 exp:8
112             SecondClassLongName("Loooooooooooooooooog"). //indent:12 exp:12
113                 getInteger(new FooReturnClass(), "Loooooooooooooooooog"), //indent:16 exp:>=12
114                    new InnerClassFoo()); //indent:19 exp:>=12
115       } //indent:6 exp:6
116     }; //indent:4 exp:4
117   } //indent:2 exp:2
118 } //indent:0 exp:0
119 
120 class SecondClassLongName { //indent:0 exp:0
121 
122   public SecondClassLongName(String string) { //indent:2 exp:2
123 
124   } //indent:2 exp:2
125 
126   String getString(FooReturnClass instance, int integer) { //indent:2 exp:2
127     return "String"; //indent:4 exp:4
128   } //indent:2 exp:2
129 
130   int getInteger(FooReturnClass instance, String string) { //indent:2 exp:2
131     return -1;   //indent:4 exp:4
132   } //indent:2 exp:2
133 
134   boolean getBoolean(FooReturnClass instance, boolean flag) { //indent:2 exp:2
135     return false; //indent:4 exp:4
136   } //indent:2 exp:2
137 
138   SecondClassLongName getInstance() { //indent:2 exp:2
139     return new SecondClassLongName("VeryLoooooooooo" //indent:4 exp:4
140         + "oongString"); //indent:8 exp:8
141   } //indent:2 exp:2
142 } //indent:0 exp:0
143 class FooReturnClass {} //indent:0 exp:0