diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java index 9ba04496e0..cab0458736 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListing.java @@ -62,7 +62,10 @@ public final class LexicographicalAnnotationAttributeListing extends BugChecker "com.fasterxml.jackson.annotation.JsonPropertyOrder#value", "io.swagger.annotations.ApiImplicitParams#value", "io.swagger.v3.oas.annotations.Parameters#value", - "javax.xml.bind.annotation.XmlType#propOrder"); + "javax.xml.bind.annotation.XmlType#propOrder", + "org.springframework.context.annotation.PropertySource#value", + "org.springframework.test.context.TestPropertySource#locations", + "org.springframework.test.context.TestPropertySource#value"); private static final String FLAG_PREFIX = "LexicographicalAnnotationAttributeListing:"; private static final String INCLUDED_ANNOTATIONS_FLAG = FLAG_PREFIX + "Includes"; private static final String EXCLUDED_ANNOTATIONS_FLAG = FLAG_PREFIX + "Excludes"; diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingTest.java index 24191fa1f4..975eef0375 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/LexicographicalAnnotationAttributeListingTest.java @@ -35,6 +35,8 @@ void identification() { "import io.swagger.v3.oas.annotations.Parameters;", "import java.math.RoundingMode;", "import javax.xml.bind.annotation.XmlType;", + "import org.springframework.context.annotation.PropertySource;", + "import org.springframework.test.context.TestPropertySource;", "", "interface A {", " @interface Foo {", @@ -144,7 +146,16 @@ void identification() { " A secondEndpoint();", "", " @XmlType(propOrder = {\"field2\", \"field1\"})", - " class Dummy {}", + " class XmlTypeDummy {}", + "", + " @PropertySource({\"field2\", \"field1\"})", + " class PropertySourceDummy {}", + "", + " @TestPropertySource(locations = {\"field2\", \"field1\"})", + " class FirstTestPropertySourceDummy {}", + "", + " @TestPropertySource({\"field2\", \"field1\"})", + " class SecondTestPropertySourceDummy {}", "}") .doTest(); }