This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/juneau.git
commit 6ad92149bb4799ae845cb2d0eeb04e606d75650d Author: Gary Gregory <[email protected]> AuthorDate: Fri Jun 23 23:36:07 2023 -0400 [juneau-common] Remove redundant modifiers --- .../java/org/apache/juneau/common/internal/IOUtils.java | 8 ++++---- .../org/apache/juneau/common/internal/StringUtils.java | 16 ++++++++-------- .../apache/juneau/common/internal/ThrowableUtils.java | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/IOUtils.java b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/IOUtils.java index d401af181..9c935a3eb 100644 --- a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/IOUtils.java +++ b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/IOUtils.java @@ -393,7 +393,7 @@ public final class IOUtils { * @return The number of bytes written. * @throws IOException If thrown from output stream. */ - public static final long pipe(byte[] in, OutputStream out, int maxBytes) throws IOException { + public static long pipe(byte[] in, OutputStream out, int maxBytes) throws IOException { if (in == null || out == null) return 0; int length = (maxBytes < 0 || maxBytes > in.length ) ? in.length : maxBytes; @@ -938,7 +938,7 @@ public final class IOUtils { return null; } - private static final byte[] byteBuffer(int maxBytes) { + private static byte[] byteBuffer(int maxBytes) { if (BYTE_BUFFER_CACHE != null) { byte[] x = BYTE_BUFFER_CACHE.get(); if (x == null) { @@ -953,7 +953,7 @@ public final class IOUtils { return new byte[buffSize(maxBytes)]; } - private static final char[] charBuffer(int maxChars) { + private static char[] charBuffer(int maxChars) { if (CHAR_BUFFER_CACHE != null) { char[] x = CHAR_BUFFER_CACHE.get(); if (x == null) { @@ -968,7 +968,7 @@ public final class IOUtils { return new char[buffSize(maxChars)]; } - private static final int buffSize(long max) { + private static int buffSize(long max) { return (max > 0 && max < BUFF_SIZE) ? (int)max : BUFF_SIZE; } } diff --git a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/StringUtils.java b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/StringUtils.java index d31e425cf..21ceaf9dc 100644 --- a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/StringUtils.java +++ b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/StringUtils.java @@ -1073,7 +1073,7 @@ public final class StringUtils { * @param num The number to convert to hex. * @return A <code><jk>char</jk>[2]</code> containing the specified characters. */ - public static final char[] toHex2(int num) { + public static char[] toHex2(int num) { if (num < 0 || num > 255) throw new NumberFormatException("toHex2 can only be used on numbers between 0 and 255"); char[] n = new char[2]; @@ -1092,7 +1092,7 @@ public final class StringUtils { * @param b The number to convert to hex. * @return A <code><jk>char</jk>[2]</code> containing the specified characters. */ - public static final String toHex(byte b) { + public static String toHex(byte b) { char[] c = new char[2]; int v = b & 0xFF; c[0] = hexArray[v >>> 4]; @@ -1106,7 +1106,7 @@ public final class StringUtils { * @param b The number to convert to hex. * @return A <code><jk>char</jk>[2]</code> containing the specified characters. */ - public static final String toReadableBytes(byte[] b) { + public static String toReadableBytes(byte[] b) { StringBuilder sb = new StringBuilder(); for (byte b2 : b) sb.append((b2 < ' ' || b2 > 'z') ? String.format("[%02X]", b2) : (char)b2 + " "); @@ -1122,7 +1122,7 @@ public final class StringUtils { * @param num The number to convert to hex. * @return A <code><jk>char</jk>[4]</code> containing the specified characters. */ - public static final char[] toHex4(int num) { + public static char[] toHex4(int num) { char[] n = new char[4]; int a = num%16; n[3] = (char)(a > 9 ? 'A'+a-10 : '0'+a); @@ -1141,7 +1141,7 @@ public final class StringUtils { * @param num The number to convert to hex. * @return A <code><jk>char</jk>[8]</code> containing the specified characters. */ - public static final char[] toHex8(long num) { + public static char[] toHex8(long num) { char[] n = new char[8]; long a = num%16; n[7] = (char)(a > 9 ? 'A'+a-10 : '0'+a); @@ -2789,7 +2789,7 @@ public final class StringUtils { * @return The input stream converted to GZip. * @throws Exception Exception occurred. */ - public static final byte[] compress(String contents) throws Exception { + public static byte[] compress(String contents) throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(contents.length()>>1); try (GZIPOutputStream gos = new GZIPOutputStream(baos)) { gos.write(contents.getBytes()); @@ -2806,7 +2806,7 @@ public final class StringUtils { * @return The string. * @throws Exception Exception occurred. */ - public static final String decompress(byte[] is) throws Exception { + public static String decompress(byte[] is) throws Exception { return read(new GZIPInputStream(new ByteArrayInputStream(is))); } @@ -2816,7 +2816,7 @@ public final class StringUtils { * @param o The object to convert. * @return The specified object as a comma-delimited list. */ - public static final String cdl(Object o) { + public static String cdl(Object o) { if (o == null) return null; if (o.getClass().isArray()) { diff --git a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/ThrowableUtils.java b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/ThrowableUtils.java index f6264fc64..9830be34a 100644 --- a/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/ThrowableUtils.java +++ b/juneau-core/juneau-common/src/main/java/org/apache/juneau/common/internal/ThrowableUtils.java @@ -88,7 +88,7 @@ public class ThrowableUtils { @SuppressWarnings("javadoc") @FunctionalInterface public interface SupplierWithThrowable<T> { - public T get() throws Throwable; + T get() throws Throwable; } /**
