diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2018-10-01 11:18:45 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2018-10-01 11:19:04 +0900 |
commit | 65d6bb073aba072a17c5324a48972b02861bf4e2 (patch) | |
tree | aa574789938b7dda1ef2b2e25e0328fdf7146052 /org.eclipse.jgit.test | |
parent | 731d638f69f017eb0471888f7a88f661e258e3ba (diff) | |
download | jgit-65d6bb073aba072a17c5324a48972b02861bf4e2.tar.gz jgit-65d6bb073aba072a17c5324a48972b02861bf4e2.zip |
Override int read(byte[], int, int) on test instances of InputStream
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>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectLoaderTest.java | 6 | ||||
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectLoaderTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectLoaderTest.java index 83e61d9ab4..055e66ed81 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectLoaderTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/ObjectLoaderTest.java @@ -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; + } }; } }; diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java index b824fae9fd..0bfa772bed 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java @@ -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( |