Modernize sal-clustering-commons
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / io / ChunkedOutputStream.java
index 73cdece20fc25da023df2250a795adb01b4a6f67..1376c6771490aeaec4adbd2085ad5b005cb92301 100644 (file)
@@ -126,14 +126,14 @@ public final class ChunkedOutputStream extends OutputStream {
 
     public Either<byte[], ChunkedByteArray> toVariant() {
         checkClosed();
-        return result instanceof byte[] ? Either.ofFirst((byte[]) result)
+        return result instanceof byte[] bytes ? Either.ofFirst(bytes)
                 : Either.ofSecond(new ChunkedByteArray(size, (ImmutableList<byte[]>) 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<byte[]>) result);
     }