1   package com.puppycrawl.tools.checkstyle.checks.indentation.indentation; //indent:0 exp:0
2   
3   /**                                                                           //indent:0 exp:0
4    * This test-input is intended to be checked using following configuration:   //indent:1 exp:1
5    *                                                                            //indent:1 exp:1
6    * arrayInitIndent = 4                                                        //indent:1 exp:1
7    * basicOffset = 2                                                            //indent:1 exp:1
8    * braceAdjustment = 0                                                        //indent:1 exp:1
9    * caseIndent = 4                                                             //indent:1 exp:1
10   * forceStrictCondition = false                                               //indent:1 exp:1
11   * lineWrappingIndentation = 4                                                //indent:1 exp:1
12   * tabWidth = 4                                                               //indent:1 exp:1
13   * throwsIndent = 4                                                           //indent:1 exp:1
14   *                                                                            //indent:1 exp:1
15   *                                                                            //indent:1 exp:1
16   */                                                                           //indent:1 exp:1
17  @MyAnnotation1 //indent:0 exp:0
18  public class //indent:0 exp:0
19      InputIndentationAnonymousClasses { //indent:4 exp:4
20    public InputIndentationAnonymousClasses(String longStr, String secondLongStr) { //indent:2 exp:2
21  
22    } //indent:2 exp:2
23    public boolean foo() { //indent:2 exp:2
24      return false; //indent:4 exp:4
25    } //indent:2 exp:2
26  
27    void foo2(StrangeInstance instance) {} //indent:2 exp:2
28  } //indent:0 exp:0
29  
30  class WithAnonymousClass { //indent:0 exp:0
31    public static final Obj2 anon = new Obj2("Looooooooooooooooong", //indent:2 exp:2
32        "SecondLoooooooooooong") { //indent:6 exp:6
33      @Override public boolean foo() { //indent:4 exp:4
34        return false; //indent:6 exp:6
35      } //indent:4 exp:4
36    }; //indent:2 exp:2
37  
38    InputIndentationAnonymousClasses foo() { //indent:2 exp:2
39      return new InputIndentationAnonymousClasses( //indent:4 exp:4
40          "Loooooooooooooooong", "SecondLoooooooooong") { //indent:8 exp:>=8
41            @Override public boolean foo() { //indent:10 exp:10
42              Obj2 obj2Intance = new Obj2("", ""); //indent:12 exp:12
43              obj2Intance.equals(new StrangeInstance(new Obj2("", "")) { //indent:12 exp:12
44                @Override void foo (String longString, String secondLongString) {} //indent:14 exp:14
45              }); //indent:12 exp:12
46              return false; //indent:12 exp:12
47            } //indent:10 exp:10
48          }; //indent:8 exp:8
49    } //indent:2 exp:2
50  } //indent:0 exp:0
51  
52  class StrangeInstance { //indent:0 exp:0
53    public StrangeInstance(Object inputIndentationAnonymousClasses) {} //indent:2 exp:2
54    void foo (String longString, String secondLongString) {} //indent:2 exp:2
55  } //indent:0 exp:0
56  
57  class Obj2 { //indent:0 exp:0
58    public Obj2(String value1, String value2) {} //indent:2 exp:2
59    boolean foo () { return true; } //indent:2 exp:2
60  } //indent:0 exp:0
61  
62  @interface MyAnnotation1 {} //indent:0 exp:0