From 03a43a380632a8a5777709c92f59e0e0f019b687 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Sat, 16 Dec 2023 15:56:28 +0100 Subject: [PATCH] Suggestions --- .../bugpatterns/StaticImportTest.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportTest.java b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportTest.java index 9de62040c3..4dde83f6e1 100644 --- a/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportTest.java +++ b/error-prone-contrib/src/test/java/tech/picnic/errorprone/bugpatterns/StaticImportTest.java @@ -107,15 +107,15 @@ void identification() { " }", "", " // BUG: Diagnostic contains:", - " @UseImportPolicy(ImportPolicy.IMPORT_TOP_LEVEL)", - " void refasterAfterTemplate() {}", - "", - " // BUG: Diagnostic contains:", " @JsonCreator(mode = JsonCreator.Mode.DELEGATING)", - " private static A create(int a) {", + " private static A jsonCreator(int a) {", " return new A();", " }", "", + " // BUG: Diagnostic contains:", + " @UseImportPolicy(ImportPolicy.IMPORT_TOP_LEVEL)", + " void refasterAfterTemplate() {}", + "", " void toImmutableMultiset() {}", "}") .doTest(); @@ -185,6 +185,11 @@ void replacement() { " @DateTimeFormat(iso = ISO.DATE_TIME) String dateTime,", " @DateTimeFormat(iso = ISO.TIME) String time) {}", "", + " @JsonCreator(mode = JsonCreator.Mode.DELEGATING)", + " private static A jsonCreator(int a) {", + " return new A();", + " }", + "", " @BugPattern(", " summary = \"\",", " linkType = BugPattern.LinkType.NONE,", @@ -194,11 +199,6 @@ void replacement() { "", " @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)", " final class Test {}", - "", - " @JsonCreator(mode = JsonCreator.Mode.DELEGATING)", - " private static A create(int a) {", - " return new A();", - " }", "}") .addOutputLines( "A.java", @@ -276,16 +276,16 @@ void replacement() { " @DateTimeFormat(iso = DATE_TIME) String dateTime,", " @DateTimeFormat(iso = TIME) String time) {}", "", + " @JsonCreator(mode = DELEGATING)", + " private static A jsonCreator(int a) {", + " return new A();", + " }", + "", " @BugPattern(summary = \"\", linkType = NONE, severity = SUGGESTION, tags = SIMPLIFICATION)", " static final class TestBugPattern {}", "", " @SpringBootTest(webEnvironment = RANDOM_PORT)", " final class Test {}", - "", - " @JsonCreator(mode = DELEGATING)", - " private static A create(int a) {", - " return new A();", - " }", "}") .doTest(TestMode.TEXT_MATCH); }