]> source.dussan.org Git - jgit.git/commitdiff
Override int read(byte[], int, int) on test instances of InputStream 16/130216/1
authorDavid Pursehouse <david.pursehouse@gmail.com>
Mon, 1 Oct 2018 02:18:45 +0000 (11:18 +0900)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Mon, 1 Oct 2018 02:19:04 +0000 (11:19 +0900)
This probably doesn't provide any benefit for the tests, but gets
rid of a warning from Error Prone.

See https://errorprone.info/bugpattern/InputStreamSlowMultibyteRead

Change-Id: I584d2e0d18475fad38747b688af6301c423f54a7
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectLoaderTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java

index 83e61d9ab43baa0814fa49b36326f3d716040593..055e66ed81dc1d1bb83a47808f165bef4e669da2 100644 (file)
@@ -260,6 +260,12 @@ public class ObjectLoaderTest {
                                                fail("never should have reached read");
                                                return -1;
                                        }
+
+                                       @Override
+                                       public int read(byte b[], int off, int len) {
+                                               fail("never should have reached read");
+                                               return -1;
+                                       }
                                };
                        }
                };
index b824fae9fdd24afe6a1a3695d721d6d8e981fe6f..0bfa772bed368f08c4f409a7f661836a5ca285f7 100644 (file)
@@ -259,6 +259,11 @@ public class UnionInputStreamTest {
                        public int read() throws IOException {
                                throw new IOException("Expected");
                        }
+
+                       @Override
+                       public int read(byte b[], int off, int len) throws IOException {
+                               throw new IOException("Expected");
+                       }
                };
                @SuppressWarnings("resource" /* java 7 */)
                final UnionInputStream u = new UnionInputStream(