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>
This commit is contained in:
parent
9bfd31fd44
commit
abefc00ac5
|
@ -167,6 +167,8 @@ public void testSkip() throws IOException {
|
||||||
|
|
||||||
u.add(new ByteArrayInputStream(new byte[] { 20, 30 }) {
|
u.add(new ByteArrayInputStream(new byte[] { 20, 30 }) {
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("UnsynchronizedOverridesSynchronized")
|
||||||
|
// This is only used in tests and is thread-safe
|
||||||
public long skip(long n) {
|
public long skip(long n) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue