From 6ed8caf4548038d2c90e1a20c433f71bec0ab7b1 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Sun, 11 Feb 2024 16:43:48 +0100 Subject: [PATCH] Use a few more text blocks --- .../errorprone/bugpatterns/MongoDBTextFilterUsage.java | 4 +++- .../picnic/errorprone/bugpatterns/RequestParamType.java | 4 +++- .../tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java | 4 +++- .../errorprone/refaster/test/RefasterRuleCollection.java | 7 ++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MongoDBTextFilterUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MongoDBTextFilterUsage.java index 88116e8eb7..ac9b44be47 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MongoDBTextFilterUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/MongoDBTextFilterUsage.java @@ -24,7 +24,9 @@ @AutoService(BugChecker.class) @BugPattern( summary = - "Avoid MongoDB's `$text` filter operator, as it can trigger heavy queries and even cause the server to run out of memory", + """ + Avoid MongoDB's `$text` filter operator, as it can trigger heavy queries and even cause \ + the server to run out of memory""", link = BUG_PATTERNS_BASE_URL + "MongoDBTextFilterUsage", linkType = CUSTOM, severity = SUGGESTION, diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java index 4455f7f149..ee736da113 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/RequestParamType.java @@ -34,7 +34,9 @@ @AutoService(BugChecker.class) @BugPattern( summary = - "By default, `@RequestParam` does not support `ImmutableCollection` and `ImmutableMap` subtypes", + """ + By default, `@RequestParam` does not support `ImmutableCollection` and `ImmutableMap` \ + subtypes""", link = BUG_PATTERNS_BASE_URL + "RequestParamType", linkType = CUSTOM, severity = ERROR, diff --git a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java index 4bc0650e18..eb9a3b072b 100644 --- a/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java +++ b/error-prone-contrib/src/main/java/tech/picnic/errorprone/bugpatterns/TimeZoneUsage.java @@ -34,7 +34,9 @@ @AutoService(BugChecker.class) @BugPattern( summary = - "Derive the current time from an existing `Clock` Spring bean, and don't rely on a `Clock`'s time zone", + """ + Derive the current time from an existing `Clock` Spring bean, and don't rely on a \ + `Clock`'s time zone""", link = BUG_PATTERNS_BASE_URL + "TimeZoneUsage", linkType = CUSTOM, severity = WARNING, diff --git a/refaster-test-support/src/main/java/tech/picnic/errorprone/refaster/test/RefasterRuleCollection.java b/refaster-test-support/src/main/java/tech/picnic/errorprone/refaster/test/RefasterRuleCollection.java index 432ee86c45..d58ec2c745 100644 --- a/refaster-test-support/src/main/java/tech/picnic/errorprone/refaster/test/RefasterRuleCollection.java +++ b/refaster-test-support/src/main/java/tech/picnic/errorprone/refaster/test/RefasterRuleCollection.java @@ -276,9 +276,10 @@ private void reportUnexpectedMatches( unexpectedMatchesByLineNumber.entries().stream() .map( e -> - String.format( - "Rule `%s` matches on line %s, while it should match in a method named `test%s`.", - e.getValue(), e.getKey(), e.getValue())) + """ + Rule `%s` matches on line %s, while it should match in a method named \ + `test%s`.""" + .formatted(e.getValue(), e.getKey(), e.getValue())) .collect(toImmutableSet()), state); }