From cd337d844e54d0d088fa591b40e681d7b5e1b639 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Fri, 19 Aug 2022 14:38:49 +0200 Subject: [PATCH] Suggestions --- .../LexicographicalAnnotationAttributeListing.java | 1 + .../LexicographicalAnnotationAttributeListingTest.java | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) 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 07ea2a7e53..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 @@ -63,6 +63,7 @@ public final class LexicographicalAnnotationAttributeListing extends BugChecker "io.swagger.annotations.ApiImplicitParams#value", "io.swagger.v3.oas.annotations.Parameters#value", "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:"; 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 c9095aca4a..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,7 @@ 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 {", @@ -145,13 +146,16 @@ void identification() { " A secondEndpoint();", "", " @XmlType(propOrder = {\"field2\", \"field1\"})", - " class FirstDummy {}", + " class XmlTypeDummy {}", + "", + " @PropertySource({\"field2\", \"field1\"})", + " class PropertySourceDummy {}", "", " @TestPropertySource(locations = {\"field2\", \"field1\"})", - " class SecondDummy {}", + " class FirstTestPropertySourceDummy {}", "", " @TestPropertySource({\"field2\", \"field1\"})", - " class ThirdDummy {}", + " class SecondTestPropertySourceDummy {}", "}") .doTest(); }