View Javadoc
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 = 4                                                            //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  @DifficultAnnotation({ //indent:0 exp:0
18      @MyType(value = Boolean.class, //indent:4 exp:4
19          name = "boolean"), //indent:8 exp:>=8
20      @MyType(value = String.class, name = "string") }) //indent:4 exp:4
21  @SimpleAnnotation //indent:0 exp:0
22  public class InputIndentationDifficultAnnotations { //indent:0 exp:0
23  
24      @DifficultAnnotation({ //indent:4 exp:4
25          @MyType(value = Boolean.class, name = "boolean"), //indent:8 exp:8
26          @MyType(value = String.class, name = "string") }) //indent:8 exp:8
27      @SimpleAnnotation //indent:4 exp:4
28      String foo = "foo"; //indent:4 exp:4
29  
30      @DifficultAnnotation({ //indent:4 exp:4
31          @MyType(value = Boolean.class, name = "boolean"), //indent:8 exp:8
32          @MyType(value = String.class, name = "string") }) //indent:8 exp:8
33      @SimpleAnnotation //indent:4 exp:4
34      void foo() { //indent:4 exp:4
35  
36      } //indent:4 exp:4
37  } //indent:0 exp:0
38  
39  @DifficultAnnotation({ //indent:0 exp:0
40  @MyType(value = Boolean.class, name = "boolean"), //indent:0 exp:4 warn
41  @MyType(value = String.class, name = "string") }) //indent:0 exp:4 warn
42  class IncorrectClass { //indent:0 exp:0
43  
44      @DifficultAnnotation({ //indent:4 exp:4
45          @MyType(value = Boolean.class, name = "boolean"), //indent:8 exp:8
46          @MyType(value = String.class, name = "string") }) //indent:8 exp:8
47      String foo = "foo"; //indent:4 exp:4
48  
49      @DifficultAnnotation({ //indent:4 exp:4
50        @MyType(value = Boolean.class, name = "boolean"), //indent:6 exp:8 warn
51          @MyType(value = String.class, name = "string") }) //indent:8 exp:8
52      void foo() { //indent:4 exp:4
53  
54      } //indent:4 exp:4
55  } //indent:0 exp:0
56  
57  @interface DifficultAnnotation { //indent:0 exp:0
58  
59      MyType[] value(); //indent:4 exp:4
60  
61  } //indent:0 exp:0
62  
63  @interface MyType { //indent:0 exp:0
64  
65      Class<?> value(); //indent:4 exp:4
66  
67      String name(); //indent:4 exp:4
68  } //indent:0 exp:0
69  
70  @interface SimpleAnnotation {} //indent:0 exp:0