X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fio%2FChunkedOutputStream.java;fp=opendaylight%2Fmd-sal%2Fsal-clustering-commons%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fio%2FChunkedOutputStream.java;h=1376c6771490aeaec4adbd2085ad5b005cb92301;hp=73cdece20fc25da023df2250a795adb01b4a6f67;hb=544f0ea584563a7398111d74eb7e89140ac02613;hpb=aee1af5ece7434962324e27ac379f035c3ca8a64 diff --git a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/io/ChunkedOutputStream.java b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/io/ChunkedOutputStream.java index 73cdece20f..1376c67714 100644 --- a/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/io/ChunkedOutputStream.java +++ b/opendaylight/md-sal/sal-clustering-commons/src/main/java/org/opendaylight/controller/cluster/io/ChunkedOutputStream.java @@ -126,14 +126,14 @@ public final class ChunkedOutputStream extends OutputStream { public Either toVariant() { checkClosed(); - return result instanceof byte[] ? Either.ofFirst((byte[]) result) + return result instanceof byte[] bytes ? Either.ofFirst(bytes) : Either.ofSecond(new ChunkedByteArray(size, (ImmutableList) result)); } @VisibleForTesting ChunkedByteArray toChunkedByteArray() { checkClosed(); - return new ChunkedByteArray(size, result instanceof byte[] ? ImmutableList.of((byte[]) result) + return new ChunkedByteArray(size, result instanceof byte[] bytes ? ImmutableList.of(bytes) : (ImmutableList) result); }