From f4eb199ba9f786a5e7e1ec8c5799d741439a028f Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sat, 10 Dec 2022 10:41:37 -0500 Subject: [PATCH] Add @SuppressWarnings --- .../commons/compress/archivers/sevenz/LZMA2Decoder.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/apache/commons/compress/archivers/sevenz/LZMA2Decoder.java b/src/main/java/org/apache/commons/compress/archivers/sevenz/LZMA2Decoder.java index c40a89e658f..289e8067ba4 100644 --- a/src/main/java/org/apache/commons/compress/archivers/sevenz/LZMA2Decoder.java +++ b/src/main/java/org/apache/commons/compress/archivers/sevenz/LZMA2Decoder.java @@ -22,7 +22,6 @@ import java.io.OutputStream; import org.apache.commons.compress.MemoryLimitException; -import org.tukaani.xz.FinishableOutputStream; import org.tukaani.xz.FinishableWrapperOutputStream; import org.tukaani.xz.LZMA2InputStream; import org.tukaani.xz.LZMA2Options; @@ -48,11 +47,10 @@ InputStream decode(final String archiveName, final InputStream in, final long un } } + @SuppressWarnings("resource") // Caller closes result. @Override OutputStream encode(final OutputStream out, final Object opts) throws IOException { - final LZMA2Options options = getOptions(opts); - final FinishableOutputStream wrapped = new FinishableWrapperOutputStream(out); - return options.getOutputStream(wrapped); + return getOptions(opts).getOutputStream(new FinishableWrapperOutputStream(out)); } @Override