aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/com
diff options
context:
space:
mode:
authorAndrei Selkin <andreyselkin@gmail.com>2017-02-20 21:03:19 +0300
committerrnveach <rveach02@gmail.com>2017-02-23 17:51:56 -0500
commit257d13b6bb53245d2491e50d4ca8e39ddfc80035 (patch)
treef7a1efc1dfe799c3b9a65ab46d2a0e4d5fdbdd6e /src/test/resources/com
parent0de913bf4d7bca3ddbbf1657d651370002536bf0 (diff)
downloadcheckstyle-257d13b6bb53245d2491e50d4ca8e39ddfc80035.tar.gz
Issue #3830: Fix bug in DesignForExtension when order of annotations changes violation
Diffstat (limited to 'src/test/resources/com')
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionIgnoredAnnotations.java27
-rw-r--r--src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionMultipleAnnotations.java84
2 files changed, 109 insertions, 2 deletions
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionIgnoredAnnotations.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionIgnoredAnnotations.java
index c8a2e36c9..3a4f37b20 100644
--- a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionIgnoredAnnotations.java
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionIgnoredAnnotations.java
@@ -138,6 +138,29 @@ public class InputDesignForExtensionIgnoredAnnotations {
@InputLocalAnnotations.ClassRule
public void foo20() { return; }
- @InputLocalAnnotations.ClassRule
- public void foo21() { return; } // violation
+ @InputLocalAnnotations.ClassRule // violation
+ public void foo21() { return; }
+
+ private int age;
+
+ @Inject // violation
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public @interface Inject { }
+
+ public @MyAnnotation void foo22() {
+ foo1();
+ }
+
+ @MyAnnotation public void foo23() {
+ foo1();
+ }
+
+ public void foo24(@MyAnnotation int a) { // violation
+ foo1();
+ }
+
+ public @interface MyAnnotation { }
}
diff --git a/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionMultipleAnnotations.java b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionMultipleAnnotations.java
new file mode 100644
index 000000000..7f9494632
--- /dev/null
+++ b/src/test/resources/com/puppycrawl/tools/checkstyle/checks/design/InputDesignForExtensionMultipleAnnotations.java
@@ -0,0 +1,84 @@
+package com.puppycrawl.tools.checkstyle.checks.design;
+
+import java.util.List;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class InputDesignForExtensionMultipleAnnotations {
+
+ @Ignore
+ @Deprecated
+ public void foo1() {
+ foo3();
+ }
+
+ @Deprecated
+ @Ignore
+ public void foo2() {
+ foo3();
+ }
+
+ @Ignore
+ // comment
+ @Deprecated
+ public void foo4() {
+ foo3();
+ }
+
+ @Deprecated
+ // comment
+ @Ignore
+ public void foo5() {
+ foo3();
+ }
+
+
+ @Ignore
+ /**
+ * comment
+ */
+ @Deprecated
+ public void foo6() {
+ foo3();
+ }
+
+ @Deprecated
+ /**
+ * comment
+ */
+ @Ignore
+ public void foo7() {
+ foo3();
+ }
+
+ @Ignore
+ /* comment */
+ @Deprecated
+ public void foo8() {
+ foo3();
+ }
+
+ @Deprecated
+ /* comment */
+ @Ignore
+ public void foo9() {
+ foo3();
+ }
+
+ /* comment */
+ @Ignore
+ @Deprecated
+ public void foo10() {
+ foo3();
+ }
+
+ /* comment */
+ @Deprecated
+ @Ignore
+ public void foo11() {
+ foo3();
+ }
+
+ private void foo3() {}
+}