View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule4841indentation;
2   
3   /** some javadoc. */
4   public class InputClassWithChainedMethods {
5   
6     /** some javadoc. */
7     public InputClassWithChainedMethods(Object... params) {}
8   
9     /** some javadoc. */
10    public static void main(String[] args) {
11      new InputClassWithChainedMethods()
12          .getInstance("string_one")
13      .doNothing("string_one".trim(), "string_two");
14      // violation above ''method call' child has incorrect indentation level 4, expected .* 8.'
15  
16      String test =
17      new InputClassWithChainedMethods("param1", "param2").getInstance().doNothing("nothing");
18      // violation above ''new' has incorrect indentation level 4, expected .* 8.'
19  
20      String test2 =
21      new InputClassWithChainedMethods("param1", "param2").getInstance().doNothing("nothing");
22      // violation above ''new' has incorrect indentation level 4, expected .* 8.'
23    }
24  
25    /** some javadoc. */
26    public String doNothing(String something, String... uselessParams) {
27      return something;
28    }
29  
30    /** some javadoc. */
31    public InputClassWithChainedMethods getInstance(String... uselessParams) {
32      return this;
33    }
34  }