From 9110201a1b052cd75adb15acc66d064515cba822 Mon Sep 17 00:00:00 2001 From: Carlos Alberto Cortez Date: Wed, 6 Dec 2017 02:37:40 -0600 Subject: [PATCH] Put braces around if-blocks for Adapters/BinaryAdapter. --- .../java/io/opentracing/propagation/Adapters.java | 12 ++++++++---- .../io/opentracing/propagation/BinaryAdapter.java | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/opentracing-api/src/main/java/io/opentracing/propagation/Adapters.java b/opentracing-api/src/main/java/io/opentracing/propagation/Adapters.java index 5a9e6809..38481bab 100644 --- a/opentracing-api/src/main/java/io/opentracing/propagation/Adapters.java +++ b/opentracing-api/src/main/java/io/opentracing/propagation/Adapters.java @@ -32,8 +32,9 @@ private Adapters() {} * @return The new Binary carrier used for injection. */ public static Binary injectBinary(OutputStream stream) { - if (stream == null) + if (stream == null) { throw new IllegalArgumentException("stream"); + } return new BinaryAdapter(Channels.newChannel(stream)); } @@ -47,8 +48,9 @@ public static Binary injectBinary(OutputStream stream) { * @return The new Binary carrier used for injection. */ public static Binary injectBinary(WritableByteChannel channel) { - if (channel == null) + if (channel == null) { throw new IllegalArgumentException("channel"); + } return new BinaryAdapter(channel); } @@ -62,8 +64,9 @@ public static Binary injectBinary(WritableByteChannel channel) { * @return The new Binary carrier used for extraction. */ public static Binary extractBinary(InputStream stream) { - if (stream == null) + if (stream == null) { throw new IllegalArgumentException("stream"); + } return new BinaryAdapter(Channels.newChannel(stream)); } @@ -77,8 +80,9 @@ public static Binary extractBinary(InputStream stream) { * @return The new Binary carrier used for extraction. */ public static Binary extractBinary(ReadableByteChannel channel) { - if (channel == null) + if (channel == null) { throw new IllegalArgumentException("channel"); + } return new BinaryAdapter(channel); } diff --git a/opentracing-api/src/main/java/io/opentracing/propagation/BinaryAdapter.java b/opentracing-api/src/main/java/io/opentracing/propagation/BinaryAdapter.java index 74df92e4..0412e691 100644 --- a/opentracing-api/src/main/java/io/opentracing/propagation/BinaryAdapter.java +++ b/opentracing-api/src/main/java/io/opentracing/propagation/BinaryAdapter.java @@ -52,15 +52,17 @@ WritableByteChannel writeChannel() { } public int write(ByteBuffer buffer) throws IOException { - if (writeChannel == null) + if (writeChannel == null) { throw new UnsupportedOperationException(); + } return writeChannel.write(buffer); } public int read(ByteBuffer buffer) throws IOException { - if (readChannel == null) + if (readChannel == null) { throw new UnsupportedOperationException(); + } return readChannel.read(buffer); }