forked from checkstyle/checkstyle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue checkstyle#9437: update AnnotationLocationCheckTest to use uniq…
…ue Input file in each test method
- Loading branch information
1 parent
3ffef52
commit ad0f5d6
Showing
4 changed files
with
307 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
...ls/checkstyle/checks/annotation/annotationlocation/InputAnnotationLocationIncorrect2.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
package com.puppycrawl.tools.checkstyle.checks.annotation.annotationlocation; | ||
|
||
/* Config: | ||
* allowSamelineSingleParameterlessAnnotation = true | ||
* allowSamelineParameterizedAnnotation = true | ||
* allowSamelineMultipleAnnotations = true | ||
*/ | ||
|
||
@MyAnn_22 @com.puppycrawl.tools.checkstyle.checks.annotation.annotationlocation.MyAnn_2 // ok | ||
(value = "") | ||
class InputAnnotationLocationIncorrect2 | ||
{ | ||
|
||
@MyAnn_22 @MyAnnotation_12(value = "") // ok | ||
public int a; | ||
|
||
@MyAnnotation_12(value = "") public int b; // ok | ||
|
||
@MyAnn_22 // ok | ||
@MyAnnotation_12 // violation | ||
(value = "") | ||
public int c; | ||
|
||
@MyAnnotation_12(value = "") // ok | ||
public int d; | ||
|
||
@MyAnn_22 // ok | ||
@MyAnnotation_12 // violation | ||
(value = "") | ||
public InputAnnotationLocationIncorrect2() {} | ||
|
||
@MyAnnotation_12("foo") @MyAnn_22 void foo1() {} // ok | ||
|
||
@MyAnnotation_12(value = "") // ok | ||
@MyAnn_22 // violation | ||
void foo2() {} | ||
|
||
@MyAnnotation_12(value = "") // ok | ||
@MyAnn_22 // violation | ||
@MyAnnotation_32 // violation | ||
@MyAnnotation_42 // violation | ||
class InnerClass | ||
{ | ||
@MyAnn_22 @MyAnnotation_12 // ok | ||
(value = "") | ||
public int a; | ||
|
||
@MyAnnotation_12(value = "") public int b; // ok | ||
|
||
@MyAnn_22 // ok | ||
@MyAnnotation_12 // violation | ||
(value = "") | ||
public int c; | ||
|
||
@MyAnnotation_12(value = "") // ok | ||
public int d; | ||
|
||
@MyAnn_22 // ok | ||
@MyAnnotation_12(value = "") public InnerClass() // ok | ||
{ | ||
// comment | ||
} | ||
@MyAnnotation_12(value = "") // ok | ||
@MyAnn_22 // violation | ||
void foo1() {} | ||
|
||
@MyAnnotation_12(value = "") // ok | ||
@MyAnn_22 // violation | ||
void foo2() {} | ||
} | ||
|
||
@MyAnnotation_12(value = "") // ok | ||
@MyAnn_22 // violation | ||
InnerClass anon = new InnerClass() | ||
{ | ||
@MyAnn_22 @MyAnnotation_12(value = "") public int a; // ok | ||
|
||
@MyAnnotation_12(value = "") public int b; // ok | ||
|
||
@MyAnn_22 // ok | ||
@MyAnnotation_12(value = "") // ok | ||
public int c; | ||
|
||
@MyAnnotation_12(value = "") // ok | ||
public int d; | ||
|
||
@MyAnnotation_12(value = "") // ok | ||
@MyAnn_22 void foo1() {} // violation | ||
|
||
@MyAnnotation_12(value = "") // ok | ||
@MyAnn_22 // violation | ||
void foo2() {} | ||
|
||
@MyAnnotation_12(value = "") void foo42() {} // ok | ||
}; | ||
|
||
} | ||
|
||
@MyAnnotation_12 // ok | ||
(value = "") | ||
@MyAnn_22 // violation | ||
class Foo2 { | ||
public void method1(@MyAnnotation_32 @MyAnn_22 Object param1) { // ok | ||
try { | ||
} | ||
catch (@MyAnnotation_32 @MyAnn_22 Exception e) { // ok | ||
} | ||
return; | ||
} | ||
} | ||
|
||
@interface MyAnnotation_12 { | ||
|
||
String value();} | ||
|
||
@interface MyAnn_22 {} | ||
|
||
@interface MyAnnotation_32 {} | ||
|
||
@interface MyAnnotation_42 {} | ||
|
||
@interface MyAnn_2 { | ||
|
||
String value();} |
Oops, something went wrong.