aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@gmail.com>2018-10-12 11:07:48 +0900
committerDavid Pursehouse <david.pursehouse@gmail.com>2018-10-17 10:29:33 +0900
commitabefc00ac58837e2f7933fbf450a74e8d673aa00 (patch)
treee6c6125d292c29c4f7cfc19d214a7840a076a5c3
parent9bfd31fd44267b82d01c99fe9a6a3f9ea3ec6a68 (diff)
downloadjgit-abefc00ac58837e2f7933fbf450a74e8d673aa00.tar.gz
jgit-abefc00ac58837e2f7933fbf450a74e8d673aa00.zip
UnionInputStreamTest: Suppress ErrorProne warning about missing synchronized
Error Prone reports that the unsynchronized method skip overrides the synchronized method in ByteArrayInputStream [1]. This is a test class, so we can just suppress the warning as recommended in [1]. Note that the suppression causes a warning in Eclipse, because it doesn't recognize the "UnsynchronizedOverridesSynchronized" as a valid value for the @SuppressWarnings annotation [2]. [1] https://errorprone.info/bugpattern/UnsynchronizedOverridesSynchronized [2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=392045 Change-Id: I3e798b448211f1363729091f72fb0ef6a873e599 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/util/io/UnionInputStreamTest.java2
1 files changed, 2 insertions, 0 deletions
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 0bfa772bed..a6e0eedfbc 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
@@ -167,6 +167,8 @@ public class UnionInputStreamTest {
u.add(new ByteArrayInputStream(new byte[] { 20, 30 }) {
@Override
+ @SuppressWarnings("UnsynchronizedOverridesSynchronized")
+ // This is only used in tests and is thread-safe
public long skip(long n) {
return 0;
}