From b2ce2bde0caf930cabfe915548de06ed29163cc4 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Thu, 8 Nov 2018 15:22:04 -0500 Subject: [PATCH] Adding @CheckReturnValue to various log-writing methods since as per https://github.com/jenkinsci/workflow-job-plugin/pull/113 I cannot seem to remember to do it. --- core/src/main/java/hudson/console/AnnotatedLargeText.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/java/hudson/console/AnnotatedLargeText.java b/core/src/main/java/hudson/console/AnnotatedLargeText.java index 6acbdeff6e..5c739b2811 100644 --- a/core/src/main/java/hudson/console/AnnotatedLargeText.java +++ b/core/src/main/java/hudson/console/AnnotatedLargeText.java @@ -52,6 +52,7 @@ import com.jcraft.jzlib.GZIPInputStream; import com.jcraft.jzlib.GZIPOutputStream; import static java.lang.Math.abs; +import javax.annotation.CheckReturnValue; import org.jenkinsci.remoting.util.AnonymousClassWarnings; /** @@ -138,6 +139,7 @@ public class AnnotatedLargeText extends LargeText { return ConsoleAnnotator.initial(context); } + @CheckReturnValue @Override public long writeLogTo(long start, Writer w) throws IOException { if (isHtml()) @@ -150,6 +152,7 @@ public class AnnotatedLargeText extends LargeText { * Strips annotations using a {@link PlainTextConsoleOutputStream}. * {@inheritDoc} */ + @CheckReturnValue @Override public long writeLogTo(long start, OutputStream out) throws IOException { return super.writeLogTo(start, new PlainTextConsoleOutputStream(out)); @@ -159,10 +162,12 @@ public class AnnotatedLargeText extends LargeText { * Calls {@link LargeText#writeLogTo(long, OutputStream)} without stripping annotations as {@link #writeLogTo(long, OutputStream)} would. * @since 1.577 */ + @CheckReturnValue public long writeRawLogTo(long start, OutputStream out) throws IOException { return super.writeLogTo(start, out); } + @CheckReturnValue public long writeHtmlTo(long start, Writer w) throws IOException { ConsoleAnnotationOutputStream caw = new ConsoleAnnotationOutputStream<>( w, createAnnotator(Stapler.getCurrentRequest()), context, charset);