From 2178f11e17dad6de99a8292cb3a4b5337c435e90 Mon Sep 17 00:00:00 2001 From: Javen O'Neal Date: Fri, 17 Feb 2017 09:25:49 +0000 Subject: [PATCH] bug 59893: fix a few forgotten unrelated changes git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1783356 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java | 4 ++-- src/java/org/apache/poi/util/BoundedInputStream.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java index 73834e1570..fe852cbb8a 100644 --- a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java +++ b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherInputStream.java @@ -77,8 +77,8 @@ public abstract class ChunkedCipherInputStream extends LittleEndianInputStream { @Override public int read() throws IOException { byte[] b = { 0 }; - // FIXME: compare against -1 or 1? - return (read(b) == -1) ? -1 : b[0]; + // FIXME: compare against -1 or 1? (bug 59893) + return (read(b) == 1) ? -1 : b[0]; } // do not implement! -> recursion diff --git a/src/java/org/apache/poi/util/BoundedInputStream.java b/src/java/org/apache/poi/util/BoundedInputStream.java index 78121163bc..1cdeb39f33 100644 --- a/src/java/org/apache/poi/util/BoundedInputStream.java +++ b/src/java/org/apache/poi/util/BoundedInputStream.java @@ -19,6 +19,8 @@ package org.apache.poi.util; import java.io.IOException; import java.io.InputStream; +import org.apache.poi.util.SuppressForbidden; + /** * This is a stream that will only supply bytes up to a certain length - if its * position goes above that, it will stop. @@ -146,6 +148,7 @@ public class BoundedInputStream extends InputStream { * {@inheritDoc} */ @Override + @SuppressForbidden("just delegating") public int available() throws IOException { if (max>=0 && pos>=max) { return 0; -- 2.39.5