From 424d77220497b38d3f2b0e8b5d811cc9d4abb7f9 Mon Sep 17 00:00:00 2001 From: Stephan Schroevers Date: Fri, 30 Sep 2022 21:54:50 +0200 Subject: [PATCH] Tweaks --- .../plugin/AnnotatedCompositeCodeTransformer.java | 9 +++------ .../tech/picnic/errorprone/refaster/runner/Refaster.java | 8 +++++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/AnnotatedCompositeCodeTransformer.java b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/AnnotatedCompositeCodeTransformer.java index ff4a1363185..515e569d4dc 100644 --- a/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/AnnotatedCompositeCodeTransformer.java +++ b/refaster-compiler/src/main/java/tech/picnic/errorprone/refaster/plugin/AnnotatedCompositeCodeTransformer.java @@ -92,13 +92,10 @@ private String getShortCheckName(String fullCheckName) { private Optional getLinkPattern(CodeTransformer delegate, String checkName) { Iterator nameComponents = CLASS_NAME_SPLITTER.splitToStream(checkName).iterator(); return getAnnotationValue(OnlineDocumentation.class, OnlineDocumentation::value, delegate) + .map(url -> url.replace(TOP_LEVEL_CLASS_URL_PLACEHOLDER, nameComponents.next())) .map( - urlPattern -> - urlPattern.replace(TOP_LEVEL_CLASS_URL_PLACEHOLDER, nameComponents.next())) - .map( - urlPattern -> - urlPattern.replace( - NESTED_CLASS_URL_PLACEHOLDER, Iterators.getNext(nameComponents, ""))); + url -> + url.replace(NESTED_CLASS_URL_PLACEHOLDER, Iterators.getNext(nameComponents, ""))); } private SeverityLevel getSeverity(CodeTransformer delegate) { diff --git a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java index 810c761fcd1..a0584703860 100644 --- a/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java +++ b/refaster-runner/src/main/java/tech/picnic/errorprone/refaster/runner/Refaster.java @@ -148,9 +148,11 @@ private static Optional toSeverityLevel(Severity severity) { } /** - * Updates the given {@link Description}'s details such that {@link - * VisitorState#reportMatch(Description)} will override the reported severity only if this bug - * checker's severity was explicitly configured. + * Updates the given {@link Description}'s details by standardizing the reported check name, + * updating the associated message, and optionally overriding its severity. + * + *

The assigned severity is overridden only if this bug checker's severity was explicitly + * configured. * *

The original check name (i.e. the Refaster template name) is prepended to the {@link * Description}'s message. The replacement check name ("Refaster Rule", a name which includes a