From cd4fc8f8856962e66eae293e964a12ae9c4f265d Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Fri, 5 Feb 2016 04:59:28 +0000 Subject: [PATCH] Statement unnecessarily nested within else clause. git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1728604 13f79535-47bb-0310-9956-ffa450edef68 --- .../client5/http/auth/util/ByteArrayBuilder.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java index 21857477f..e606fb451 100644 --- a/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java +++ b/httpclient5/src/main/java/org/apache/hc/client5/http/auth/util/ByteArrayBuilder.java @@ -68,9 +68,8 @@ public class ByteArrayBuilder { buffer.flip(); newBuffer.put(buffer); return newBuffer; - } else { - return buffer; } + return buffer; } static ByteBuffer encode( @@ -186,13 +185,12 @@ public class ByteArrayBuilder { public byte[] toByteArray() { if (this.buffer == null) { return new byte[] {}; - } else { - this.buffer.flip(); - final byte[] b = new byte[this.buffer.remaining()]; - this.buffer.get(b); - this.buffer.clear(); - return b; } + this.buffer.flip(); + final byte[] b = new byte[this.buffer.remaining()]; + this.buffer.get(b); + this.buffer.clear(); + return b; } public void reset() {