From 9fe27eb8e3d1ff96839f5dc33c8645974926967f Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 3 Jul 2019 17:23:02 +0200 Subject: [PATCH] Updated all arrays after merge of #3846 Signed-off-by: Greg Wilkins --- .../eclipse/jetty/http/CookieCutterTest.java | 20 ++++---- .../eclipse/jetty/servlets/GzipTester.java | 2 +- .../java/org/eclipse/jetty/servlets/Hex.java | 4 +- .../common/messages/MessageWriterTest.java | 8 ++-- .../javax/common/util/InvokerUtilsTest.java | 46 +++++++++---------- .../util/InvokerUtils_StaticParamsTest.java | 6 +-- .../common/util/NameParamIdentifier.java | 2 +- .../server/browser/JsrBrowserSocket.java | 14 +++--- .../client/DecoderReaderManySmallTest.java | 2 +- .../tests/client/MessageReceivingTest.java | 6 +-- .../tests/coders/AvailableDecodersTest.java | 2 +- .../tests/coders/AvailableEncodersTest.java | 2 +- .../tests/server/LargeAnnotatedTest.java | 2 +- .../tests/server/LargeContainerTest.java | 2 +- .../javax/tests/server/PingPongTest.java | 4 +- .../javax/tests/server/PongSocket.java | 2 +- .../server/PrimitivesBinaryEchoTest.java | 2 +- .../tests/server/SessionTrackingTest.java | 2 +- .../sockets/pong/PongMessageEndpoint.java | 2 +- .../src/test/java/examples/ClientDemo.java | 2 +- .../common/MessageInputStreamTest.java | 8 ++-- .../common/MessageOutputStreamTest.java | 2 +- .../websocket/common/MessageWriterTest.java | 2 +- .../common/invoke/InvokerUtilsTest.java | 46 +++++++++---------- .../common/invoke/NameParamIdentifier.java | 2 +- .../common/util/Utf8CharBufferTest.java | 12 ++--- .../server/browser/BrowserSocket.java | 14 +++--- .../jetty/websocket/core/AcceptHashTest.java | 2 +- .../jetty/websocket/core/CloseStatusTest.java | 2 +- .../core/GeneratorParserRoundtripTest.java | 2 +- .../jetty/websocket/core/GeneratorTest.java | 26 +++++------ .../core/ParsePayloadLengthTest.java | 2 +- .../websocket/core/ParserReservedBitTest.java | 4 +- .../jetty/websocket/core/ParserTest.java | 16 +++---- .../extensions/DeflateFrameExtensionTest.java | 20 ++++---- .../core/extensions/ExtensionConfigTest.java | 4 +- .../core/extensions/ExtensionTool.java | 4 +- .../java/com/acme/test/MultiPartTest.java | 2 +- 38 files changed, 151 insertions(+), 151 deletions(-) diff --git a/jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterTest.java b/jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterTest.java index de27eb12d82..22516a5c024 100644 --- a/jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterTest.java +++ b/jetty-http/src/test/java/org/eclipse/jetty/http/CookieCutterTest.java @@ -59,7 +59,7 @@ public class CookieCutterTest { String rawCookie = "$Version=\"1\"; Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\""; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); assertThat("Cookies.length", cookies.length, is(1)); assertCookie("Cookies[0]", cookies[0], "Customer", "WILE_E_COYOTE", 1, "/acme"); @@ -75,7 +75,7 @@ public class CookieCutterTest "Customer=\"WILE_E_COYOTE\"; $Path=\"/acme\"; " + "Part_Number=\"Rocket_Launcher_0001\"; $Path=\"/acme\""; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); assertThat("Cookies.length", cookies.length, is(2)); assertCookie("Cookies[0]", cookies[0], "Customer", "WILE_E_COYOTE", 1, "/acme"); @@ -93,7 +93,7 @@ public class CookieCutterTest "Part_Number=\"Rocket_Launcher_0001\"; $Path=\"/acme\"; " + "Shipping=\"FedEx\"; $Path=\"/acme\""; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); assertThat("Cookies.length", cookies.length, is(3)); assertCookie("Cookies[0]", cookies[0], "Customer", "WILE_E_COYOTE", 1, "/acme"); @@ -111,7 +111,7 @@ public class CookieCutterTest "Part_Number=\"Riding_Rocket_0023\"; $Path=\"/acme/ammo\"; " + "Part_Number=\"Rocket_Launcher_0001\"; $Path=\"/acme\""; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); assertThat("Cookies.length", cookies.length, is(2)); assertCookie("Cookies[0]", cookies[0], "Part_Number", "Riding_Rocket_0023", 1, "/acme/ammo"); @@ -128,7 +128,7 @@ public class CookieCutterTest "session_id=\"1234\"; " + "session_id=\"1111\"; $Domain=\".cracker.edu\""; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); assertThat("Cookies.length", cookies.length, is(2)); assertCookie("Cookies[0]", cookies[0], "session_id", "1234", 1, null); @@ -144,7 +144,7 @@ public class CookieCutterTest String rawCookie = "$Version=\"1\"; session_id=\"1234\", " + "$Version=\"1\"; session_id=\"1111\"; $Domain=\".cracker.edu\""; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC2965, rawCookie); assertThat("Cookies.length", cookies.length, is(2)); assertCookie("Cookies[0]", cookies[0], "session_id", "1234", 1, null); @@ -164,7 +164,7 @@ public class CookieCutterTest { String rawCookie = "SID=31d4d96e407aad42"; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie); assertThat("Cookies.length", cookies.length, is(1)); assertCookie("Cookies[0]", cookies[0], "SID", "31d4d96e407aad42", 0, null); @@ -178,7 +178,7 @@ public class CookieCutterTest { String rawCookie = "SID=31d4d96e407aad42; lang=en-US"; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie); assertThat("Cookies.length", cookies.length, is(2)); assertCookie("Cookies[0]", cookies[0], "SID", "31d4d96e407aad42", 0, null); @@ -193,7 +193,7 @@ public class CookieCutterTest { String rawCookie = "key=value"; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie); assertThat("Cookies.length", cookies.length, is(1)); assertCookie("Cookies[0]", cookies[0], "key", "value", 0, null); @@ -207,7 +207,7 @@ public class CookieCutterTest { String rawCookie = "$key=value"; - Cookie cookies[] = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie); + Cookie[] cookies = parseCookieHeaders(CookieCompliance.RFC6265, rawCookie); assertThat("Cookies.length", cookies.length, is(0)); } diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipTester.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipTester.java index 9738a1dcc0f..94e1d6925bc 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipTester.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/GzipTester.java @@ -149,7 +149,7 @@ public class GzipTester digester = new DigestOutputStream(uncompressedStream, digest); IO.copy(in, digester); - byte output[] = uncompressedStream.toByteArray(); + byte[] output = uncompressedStream.toByteArray(); String actualSha1Sum = Hex.asHex(digest.digest()); return new ContentMetadata(output.length, actualSha1Sum); } diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/Hex.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/Hex.java index 14e6f5756f6..be46ec8580e 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/Hex.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/Hex.java @@ -29,7 +29,7 @@ public final class Hex throw new IllegalArgumentException(String.format("Invalid ID length of <%d> expected range of <0> to <%d>", id.length(), (size * 2))); } - byte buf[] = new byte[size]; + byte[] buf = new byte[size]; byte hex; int len = id.length(); @@ -60,7 +60,7 @@ public final class Hex public static String asHex(byte buf[]) { int len = buf.length; - char out[] = new char[len * 2]; + char[] out = new char[len * 2]; for (int i = 0; i < len; i++) { out[i * 2] = hexcodes[(buf[i] & 0xF0) >> 4]; diff --git a/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/messages/MessageWriterTest.java b/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/messages/MessageWriterTest.java index 519bb86b6a4..24efba23ce2 100644 --- a/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/messages/MessageWriterTest.java +++ b/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/messages/MessageWriterTest.java @@ -42,7 +42,7 @@ public class MessageWriterTest FrameCapture capture = new FrameCapture(); try (MessageWriter writer = new MessageWriter(capture, 1024)) { - char cbuf[] = new char[512]; + char[] cbuf = new char[512]; Arrays.fill(cbuf, 'x'); writer.write(cbuf); } @@ -59,7 +59,7 @@ public class MessageWriterTest FrameCapture capture = new FrameCapture(); try (MessageWriter writer = new MessageWriter(capture, 1024)) { - char cbuf[] = new char[1024 * 2]; + char[] cbuf = new char[1024 * 2]; Arrays.fill(cbuf, 'x'); writer.write(cbuf); } @@ -85,7 +85,7 @@ public class MessageWriterTest FrameCapture capture = new FrameCapture(); try (MessageWriter writer = new MessageWriter(capture, writerBufferSize)) { - char cbuf[] = new char[testSize]; + char[] cbuf = new char[testSize]; Arrays.fill(cbuf, 'x'); int remaining = cbuf.length; int offset = 0; @@ -127,7 +127,7 @@ public class MessageWriterTest WholeMessageCapture capture = new WholeMessageCapture(); try (MessageWriter writer = new MessageWriter(capture, writerBufferSize)) { - char cbuf[] = new char[testSize]; + char[] cbuf = new char[testSize]; Arrays.fill(cbuf, 'x'); for (int i = 0; i < testSize; i++) { diff --git a/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/InvokerUtilsTest.java b/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/InvokerUtilsTest.java index 603b71c8704..8af8fcc8ab4 100644 --- a/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/InvokerUtilsTest.java +++ b/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/InvokerUtilsTest.java @@ -165,7 +165,7 @@ public class InvokerUtilsTest { Method method2 = ReflectUtils.findMethod(KeyValue.class, "onEntry", int.class, String.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(int.class) }; @@ -182,7 +182,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(int.class) }; @@ -199,7 +199,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(int.class), new InvokerUtils.Arg(Boolean.class) @@ -217,7 +217,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(Long.class), new InvokerUtils.Arg(int.class) @@ -235,7 +235,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(Simple.class), new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(int.class) @@ -253,7 +253,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(Simple.class), new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(Boolean.class), @@ -273,7 +273,7 @@ public class InvokerUtilsTest { Method method = ReflectUtils.findMethod(NamedParams.class, "onMessage", String.class, String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class, "fruit"), new InvokerUtils.Arg(String.class, "color"), new InvokerUtils.Arg(int.class, "cost") @@ -291,7 +291,7 @@ public class InvokerUtilsTest { Method method = ReflectUtils.findMethod(NamedParams.class, "onMessage", String.class, String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(int.class, "cost"), new InvokerUtils.Arg(String.class, "fruit"), new InvokerUtils.Arg(String.class, "color") @@ -310,7 +310,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigEmpty"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{}; + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{}; MethodHandle methodHandle = InvokerUtils.mutatedInvoker(SampleSignatures.class, method, callingArgs); String result = (String)methodHandle.invoke(samples); @@ -323,7 +323,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigEmpty"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class) }; @@ -338,7 +338,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigEmpty"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class) }; @@ -353,7 +353,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class) }; @@ -368,7 +368,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) }; @@ -384,7 +384,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(File.class) }; @@ -400,7 +400,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStrFile"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(File.class) }; @@ -416,7 +416,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStrFile"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) }; @@ -432,7 +432,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(File.class) }; @@ -448,7 +448,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) }; @@ -464,7 +464,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(boolean.class, "fin") @@ -481,7 +481,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(boolean.class) @@ -498,7 +498,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(boolean.class, "fin"), new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) @@ -515,7 +515,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(boolean.class), new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) @@ -532,7 +532,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(boolean.class, "fin"), new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) diff --git a/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/InvokerUtils_StaticParamsTest.java b/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/InvokerUtils_StaticParamsTest.java index 2148821b6b0..60760007d9f 100644 --- a/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/InvokerUtils_StaticParamsTest.java +++ b/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/InvokerUtils_StaticParamsTest.java @@ -64,7 +64,7 @@ public class InvokerUtils_StaticParamsTest Method method = ReflectUtils.findMethod(Foo.class, "onFruit", String.class); // Declared Variable Names - final String namedVariables[] = new String[]{ + final String[] namedVariables = new String[]{ "fruit" }; @@ -95,7 +95,7 @@ public class InvokerUtils_StaticParamsTest Method method = ReflectUtils.findMethod(Foo.class, "onCount", int.class); // Declared Variable Names - as seen in url-template-pattern - final String namedVariables[] = new String[]{ + final String[] namedVariables = new String[]{ "count" }; @@ -124,7 +124,7 @@ public class InvokerUtils_StaticParamsTest Method method = ReflectUtils.findMethod(Foo.class, "onLabeledCount", String.class, int.class); // Declared Variable Names - as seen in url-template-pattern - final String namedVariables[] = new String[]{ + final String[] namedVariables = new String[]{ "count" }; diff --git a/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/NameParamIdentifier.java b/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/NameParamIdentifier.java index 636adff2e5c..e88b955ccdd 100644 --- a/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/NameParamIdentifier.java +++ b/jetty-websocket/javax-websocket-common/src/test/java/org/eclipse/jetty/websocket/javax/common/util/NameParamIdentifier.java @@ -32,7 +32,7 @@ public class NameParamIdentifier implements InvokerUtils.ParamIdentifier @Override public InvokerUtils.Arg getParamArg(Method method, Class paramType, int idx) { - Annotation annos[] = method.getParameterAnnotations()[idx]; + Annotation[] annos = method.getParameterAnnotations()[idx]; if (annos != null || (annos.length > 0)) { for (Annotation anno : annos) diff --git a/jetty-websocket/javax-websocket-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserSocket.java b/jetty-websocket/javax-websocket-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserSocket.java index 9b19e04cca7..ad8d1f3be6d 100644 --- a/jetty-websocket/javax-websocket-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserSocket.java +++ b/jetty-websocket/javax-websocket-server/src/test/java/org/eclipse/jetty/websocket/javax/server/browser/JsrBrowserSocket.java @@ -55,9 +55,9 @@ public class JsrBrowserSocket @Override public void run() { - char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-|{}[]():".toCharArray(); + char[] letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-|{}[]():".toCharArray(); int lettersLen = letters.length; - char randomText[] = new char[size]; + char[] randomText = new char[size]; Random rand = new Random(42); String msg; @@ -141,7 +141,7 @@ public class JsrBrowserSocket } case "many": { - String parts[] = StringUtil.csvSplit(val); + String[] parts = StringUtil.csvSplit(val); int size = Integer.parseInt(parts[0]); int count = Integer.parseInt(parts[1]); @@ -150,12 +150,12 @@ public class JsrBrowserSocket } case "manythreads": { - String parts[] = StringUtil.csvSplit(val); + String[] parts = StringUtil.csvSplit(val); int threadCount = Integer.parseInt(parts[0]); int size = Integer.parseInt(parts[1]); int count = Integer.parseInt(parts[2]); - Thread threads[] = new Thread[threadCount]; + Thread[] threads = new Thread[threadCount]; // Setup threads for (int n = 0; n < threadCount; n++) @@ -194,9 +194,9 @@ public class JsrBrowserSocket private void writeManyAsync(int size, int count) { - char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-|{}[]():".toCharArray(); + char[] letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-|{}[]():".toCharArray(); int lettersLen = letters.length; - char randomText[] = new char[size]; + char[] randomText = new char[size]; Random rand = new Random(42); for (int n = 0; n < count; n++) diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/DecoderReaderManySmallTest.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/DecoderReaderManySmallTest.java index ce927112b20..1de873294be 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/DecoderReaderManySmallTest.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/DecoderReaderManySmallTest.java @@ -174,7 +174,7 @@ public class DecoderReaderManySmallTest { if (text.startsWith("seq|")) { - String parts[] = text.split("\\|"); + String[] parts = text.split("\\|"); int from = Integer.parseInt(parts[1]); int to = Integer.parseInt(parts[2]); diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/MessageReceivingTest.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/MessageReceivingTest.java index 731880803df..62bbace21bd 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/MessageReceivingTest.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/client/MessageReceivingTest.java @@ -114,7 +114,7 @@ public class MessageReceivingTest { session.getBasicRemote().sendBinary(BufferUtil.toBuffer("", UTF_8)); session.getBasicRemote().sendBinary(BufferUtil.toBuffer("Echo", UTF_8)); - byte bigBuf[] = new byte[1024 * 1024]; + byte[] bigBuf = new byte[1024 * 1024]; Arrays.fill(bigBuf, (byte)'x'); // allocate fresh ByteBuffer and copy array contents, not wrap // as the send will modify the wrapped array (for client masking purposes) @@ -215,7 +215,7 @@ public class MessageReceivingTest .preferredSubprotocols(Collections.singletonList("echo")) .build(); - byte raw[] = new byte[1024 * 1024]; + byte[] raw = new byte[1024 * 1024]; Arrays.fill(raw, (byte)'x'); String veryLongString = new String(raw, UTF_8); @@ -245,7 +245,7 @@ public class MessageReceivingTest @Override public void onText(String wholeMessage, Callback callback) { - String parts[] = wholeMessage.split(" "); + String[] parts = wholeMessage.split(" "); for (int i = 0; i < parts.length; i++) { if (i > 0) diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableDecodersTest.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableDecodersTest.java index 92b62d312a6..b57b76608dd 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableDecodersTest.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableDecodersTest.java @@ -188,7 +188,7 @@ public class AvailableDecodersTest public void testCoreDecode_ByteArray() throws IllegalAccessException, InstantiationException, DecodeException { ByteBuffer val = Hex.asByteBuffer("112233445566778899"); - byte expected[] = Hex.asByteArray("112233445566778899"); + byte[] expected = Hex.asByteArray("112233445566778899"); assertBinaryDecoder(byte[].class, val, expected); } diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableEncodersTest.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableEncodersTest.java index b8e015253e6..60c4c030f16 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableEncodersTest.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/coders/AvailableEncodersTest.java @@ -200,7 +200,7 @@ public class AvailableEncodersTest @Test public void testCoreEncoder_ByteArray() throws IllegalAccessException, InstantiationException, EncodeException { - byte buf[] = Hex.asByteArray("998877665544332211"); + byte[] buf = Hex.asByteArray("998877665544332211"); assertBinaryEncoder(byte[].class, buf, "998877665544332211"); } diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/LargeAnnotatedTest.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/LargeAnnotatedTest.java index 020f08234c2..91a702836d1 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/LargeAnnotatedTest.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/LargeAnnotatedTest.java @@ -90,7 +90,7 @@ public class LargeAnnotatedTest { // The message size should be bigger than default, but smaller than the limit that LargeEchoSocket specifies - byte txt[] = new byte[100 * 1024]; + byte[] txt = new byte[100 * 1024]; Arrays.fill(txt, (byte)'o'); String msg = new String(txt, StandardCharsets.UTF_8); coreSession.sendFrame(new Frame(OpCode.TEXT).setPayload(msg), Callback.NOOP, false); diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/LargeContainerTest.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/LargeContainerTest.java index 40b61beb7c4..21ffd70a40a 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/LargeContainerTest.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/LargeContainerTest.java @@ -111,7 +111,7 @@ public class LargeContainerTest try { // The message size should be bigger than default, but smaller than the limit that LargeEchoSocket specifies - byte txt[] = new byte[100 * 1024]; + byte[] txt = new byte[100 * 1024]; Arrays.fill(txt, (byte)'o'); String msg = new String(txt, StandardCharsets.UTF_8); coreSession.sendFrame(new Frame(OpCode.TEXT).setPayload(msg), Callback.NOOP, false); diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PingPongTest.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PingPongTest.java index a46fffd0672..1b44cdc23f0 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PingPongTest.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PingPongTest.java @@ -83,7 +83,7 @@ public class PingPongTest { if (LOG.isDebugEnabled()) LOG.debug("PongSocket.onPong(): PongMessage.appData={}", BufferUtil.toDetailString(pong.getApplicationData())); - byte buf[] = BufferUtil.toArray(pong.getApplicationData()); + byte[] buf = BufferUtil.toArray(pong.getApplicationData()); String message = new String(buf, StandardCharsets.UTF_8); this.session.getAsyncRemote().sendText("PongSocket.onPong(PongMessage)[" + path + "]:" + message); } @@ -105,7 +105,7 @@ public class PingPongTest @Override public void onMessage(PongMessage pong) { - byte buf[] = BufferUtil.toArray(pong.getApplicationData()); + byte[] buf = BufferUtil.toArray(pong.getApplicationData()); String message = new String(buf, StandardCharsets.UTF_8); this.session.getAsyncRemote().sendText("PongMessageEndpoint.onMessage(PongMessage):[" + path + "]:" + message); } diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PongSocket.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PongSocket.java index 471595c7fc8..f6eb7cb15d7 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PongSocket.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PongSocket.java @@ -49,7 +49,7 @@ public class PongSocket { if (LOG.isDebugEnabled()) LOG.debug("PongSocket.onPong(): PongMessage.appData={}", BufferUtil.toDetailString(pong.getApplicationData())); - byte buf[] = BufferUtil.toArray(pong.getApplicationData()); + byte[] buf = BufferUtil.toArray(pong.getApplicationData()); String message = new String(buf, StandardCharsets.UTF_8); this.session.getAsyncRemote().sendText("PongSocket.onPong(PongMessage)[" + path + "]:" + message); } diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesBinaryEchoTest.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesBinaryEchoTest.java index 673aa9b1478..543263f6564 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesBinaryEchoTest.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/PrimitivesBinaryEchoTest.java @@ -77,7 +77,7 @@ public class PrimitivesBinaryEchoTest @OnMessage public byte[] onMessage(byte[] buf) throws IOException { - byte ret[] = new byte[buf.length + 1]; + byte[] ret = new byte[buf.length + 1]; ret[0] = (byte)0xFE; // proof that this endpoint got it System.arraycopy(buf, 0, ret, 1, buf.length); return ret; diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java index 61250f3cc13..b7de619e7ab 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/SessionTrackingTest.java @@ -62,7 +62,7 @@ public class SessionTrackingTest return; } - String parts[] = msg.split("\\|"); + String[] parts = msg.split("\\|"); if ("openSessions".equals(parts[0])) { diff --git a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/pong/PongMessageEndpoint.java b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/pong/PongMessageEndpoint.java index d6937b6d36c..c6b12f79fe1 100644 --- a/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/pong/PongMessageEndpoint.java +++ b/jetty-websocket/javax-websocket-tests/src/test/java/org/eclipse/jetty/websocket/javax/tests/server/sockets/pong/PongMessageEndpoint.java @@ -43,7 +43,7 @@ public class PongMessageEndpoint extends Endpoint implements MessageHandler.Whol @Override public void onMessage(PongMessage pong) { - byte buf[] = BufferUtil.toArray(pong.getApplicationData()); + byte[] buf = BufferUtil.toArray(pong.getApplicationData()); String message = new String(buf, StandardCharsets.UTF_8); this.session.getAsyncRemote().sendText("PongMessageEndpoint.onMessage(PongMessage):[" + path + "]:" + message); } diff --git a/jetty-websocket/jetty-websocket-client/src/test/java/examples/ClientDemo.java b/jetty-websocket/jetty-websocket-client/src/test/java/examples/ClientDemo.java index 05452cf7e49..1d236ba543d 100644 --- a/jetty-websocket/jetty-websocket-client/src/test/java/examples/ClientDemo.java +++ b/jetty-websocket/jetty-websocket-client/src/test/java/examples/ClientDemo.java @@ -201,7 +201,7 @@ public class ClientDemo op = OpCode.BINARY; } - byte data[] = null; + byte[] data = null; switch (op) { diff --git a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageInputStreamTest.java b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageInputStreamTest.java index 70bb77c783f..84134e2d322 100644 --- a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageInputStreamTest.java +++ b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageInputStreamTest.java @@ -62,7 +62,7 @@ public class MessageInputStreamTest stream.accept(frame, Callback.NOOP); // Read entire message it from the stream. - byte data[] = IO.readBytes(stream); + byte[] data = IO.readBytes(stream); String message = new String(data, 0, data.length, StandardCharsets.UTF_8); // Test it @@ -106,7 +106,7 @@ public class MessageInputStreamTest startLatch.await(); // Read it from the stream. - byte data[] = IO.readBytes(stream); + byte[] data = IO.readBytes(stream); String message = new String(data, 0, data.length, StandardCharsets.UTF_8); // Test it @@ -204,7 +204,7 @@ public class MessageInputStreamTest stream.accept(msg3, Callback.NOOP); // Read entire message it from the stream. - byte data[] = IO.readBytes(stream); + byte[] data = IO.readBytes(stream); String message = new String(data, 0, data.length, StandardCharsets.UTF_8); // Test it @@ -232,7 +232,7 @@ public class MessageInputStreamTest stream.accept(msg3, Callback.NOOP); // Read entire message it from the stream. - byte data[] = IO.readBytes(stream); + byte[] data = IO.readBytes(stream); String message = new String(data, 0, data.length, StandardCharsets.UTF_8); // Test it diff --git a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageOutputStreamTest.java b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageOutputStreamTest.java index 50e8eacb484..55d491b6ef3 100644 --- a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageOutputStreamTest.java +++ b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageOutputStreamTest.java @@ -89,7 +89,7 @@ public class MessageOutputStreamTest public void testWriteLarge_RequiringMultipleBuffers() throws Exception { int bufsize = (int)(OUTPUT_BUFFER_SIZE * 2.5); - byte buf[] = new byte[bufsize]; + byte[] buf = new byte[bufsize]; LOG.debug("Buffer sizes: max:{}, test:{}", OUTPUT_BUFFER_SIZE, bufsize); Arrays.fill(buf, (byte)'x'); buf[bufsize - 1] = (byte)'o'; // mark last entry for debugging diff --git a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageWriterTest.java b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageWriterTest.java index 4567ccb5935..8db970f469a 100644 --- a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageWriterTest.java +++ b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/MessageWriterTest.java @@ -83,7 +83,7 @@ public class MessageWriterTest public void testWriteLarge_RequiringMultipleBuffers() throws Exception { int size = (int)(OUTPUT_BUFFER_SIZE * 2.5); - char buf[] = new char[size]; + char[] buf = new char[size]; if (LOG.isDebugEnabled()) LOG.debug("Buffer size: {}", size); Arrays.fill(buf, 'x'); diff --git a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/invoke/InvokerUtilsTest.java b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/invoke/InvokerUtilsTest.java index e3235fbe6fb..3e62ab1c5cb 100644 --- a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/invoke/InvokerUtilsTest.java +++ b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/invoke/InvokerUtilsTest.java @@ -165,7 +165,7 @@ public class InvokerUtilsTest { Method method2 = ReflectUtils.findMethod(KeyValue.class, "onEntry", int.class, String.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(int.class) }; @@ -182,7 +182,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(int.class) }; @@ -199,7 +199,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(int.class), new InvokerUtils.Arg(Boolean.class) @@ -217,7 +217,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(Long.class), new InvokerUtils.Arg(int.class) @@ -235,7 +235,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(Simple.class), new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(int.class) @@ -253,7 +253,7 @@ public class InvokerUtilsTest { Method method1 = ReflectUtils.findMethod(KeyValue.class, "onEntry", String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(Simple.class), new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(Boolean.class), @@ -273,7 +273,7 @@ public class InvokerUtilsTest { Method method = ReflectUtils.findMethod(NamedParams.class, "onMessage", String.class, String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class, "fruit"), new InvokerUtils.Arg(String.class, "color"), new InvokerUtils.Arg(int.class, "cost") @@ -291,7 +291,7 @@ public class InvokerUtilsTest { Method method = ReflectUtils.findMethod(NamedParams.class, "onMessage", String.class, String.class, int.class); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(int.class, "cost"), new InvokerUtils.Arg(String.class, "fruit"), new InvokerUtils.Arg(String.class, "color") @@ -310,7 +310,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigEmpty"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{}; + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{}; MethodHandle methodHandle = InvokerUtils.mutatedInvoker(SampleSignatures.class, method, callingArgs); String result = (String)methodHandle.invoke(samples); @@ -323,7 +323,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigEmpty"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class) }; @@ -338,7 +338,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigEmpty"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class) }; @@ -353,7 +353,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class) }; @@ -368,7 +368,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) }; @@ -384,7 +384,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(File.class) }; @@ -400,7 +400,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStrFile"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(File.class) }; @@ -416,7 +416,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigStrFile"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) }; @@ -432,7 +432,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(File.class) }; @@ -448,7 +448,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStr"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) }; @@ -464,7 +464,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(boolean.class, "fin") @@ -481,7 +481,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class), new InvokerUtils.Arg(boolean.class) @@ -498,7 +498,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(boolean.class, "fin"), new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) @@ -515,7 +515,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(boolean.class), new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) @@ -532,7 +532,7 @@ public class InvokerUtilsTest SampleSignatures samples = new SampleSignatures(); Method method = findMethodByName(samples, "sigFileStrFin"); - InvokerUtils.Arg callingArgs[] = new InvokerUtils.Arg[]{ + InvokerUtils.Arg[] callingArgs = new InvokerUtils.Arg[]{ new InvokerUtils.Arg(boolean.class, "fin"), new InvokerUtils.Arg(File.class), new InvokerUtils.Arg(String.class) diff --git a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/invoke/NameParamIdentifier.java b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/invoke/NameParamIdentifier.java index aae517b9cff..ff2e49181ff 100644 --- a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/invoke/NameParamIdentifier.java +++ b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/invoke/NameParamIdentifier.java @@ -32,7 +32,7 @@ public class NameParamIdentifier implements InvokerUtils.ParamIdentifier @Override public InvokerUtils.Arg getParamArg(Method method, Class paramType, int idx) { - Annotation annos[] = method.getParameterAnnotations()[idx]; + Annotation[] annos = method.getParameterAnnotations()[idx]; if (annos != null || (annos.length > 0)) { for (Annotation anno : annos) diff --git a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/util/Utf8CharBufferTest.java b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/util/Utf8CharBufferTest.java index 7e75895be20..742086dcdd9 100644 --- a/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/util/Utf8CharBufferTest.java +++ b/jetty-websocket/jetty-websocket-common/src/test/java/org/eclipse/jetty/websocket/common/util/Utf8CharBufferTest.java @@ -45,8 +45,8 @@ public class Utf8CharBufferTest ByteBuffer buf = ByteBuffer.allocate(128); Utf8CharBuffer utf = Utf8CharBuffer.wrap(buf); - byte hellobytes[] = asUTF("Hello "); - byte worldbytes[] = asUTF("World!"); + byte[] hellobytes = asUTF("Hello "); + byte[] worldbytes = asUTF("World!"); utf.append(hellobytes, 0, hellobytes.length); ByteBuffer hellobuf = utf.getByteBuffer(); @@ -67,7 +67,7 @@ public class Utf8CharBufferTest int expectedSize = bufsize / 2; assertThat("Remaining (initial)", utf.remaining(), is(expectedSize)); - byte hellobytes[] = asUTF("Hello World"); + byte[] hellobytes = asUTF("Hello World"); utf.append(hellobytes, 0, hellobytes.length); ByteBuffer hellobuf = utf.getByteBuffer(); @@ -79,7 +79,7 @@ public class Utf8CharBufferTest assertThat("Remaining (after clear)", utf.remaining(), is(expectedSize)); - byte whatnowbytes[] = asUTF("What Now?"); + byte[] whatnowbytes = asUTF("What Now?"); utf.append(whatnowbytes, 0, whatnowbytes.length); ByteBuffer whatnowbuf = utf.getByteBuffer(); @@ -93,7 +93,7 @@ public class Utf8CharBufferTest ByteBuffer buf = ByteBuffer.allocate(64); Utf8CharBuffer utf = Utf8CharBuffer.wrap(buf); - byte bb[] = asUTF("Hello A\u00ea\u00f1\u00fcC"); + byte[] bb = asUTF("Hello A\u00ea\u00f1\u00fcC"); utf.append(bb, 0, bb.length); ByteBuffer actual = utf.getByteBuffer(); @@ -111,7 +111,7 @@ public class Utf8CharBufferTest int expectedSize = bufsize / 2; assertThat("Remaining (initial)", utf.remaining(), is(expectedSize)); - byte bb[] = asUTF("Hello World"); + byte[] bb = asUTF("Hello World"); utf.append(bb, 0, bb.length); expectedSize -= bb.length; diff --git a/jetty-websocket/jetty-websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java b/jetty-websocket/jetty-websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java index f3febf66a19..848e92a6f47 100644 --- a/jetty-websocket/jetty-websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java +++ b/jetty-websocket/jetty-websocket-server/src/test/java/org/eclipse/jetty/websocket/server/browser/BrowserSocket.java @@ -62,9 +62,9 @@ public class BrowserSocket @Override public void run() { - char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-|{}[]():".toCharArray(); + char[] letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-|{}[]():".toCharArray(); int lettersLen = letters.length; - char randomText[] = new char[size]; + char[] randomText = new char[size]; Random rand = new Random(42); String msg; @@ -204,7 +204,7 @@ public class BrowserSocket } case "many": { - String parts[] = val.split(","); + String[] parts = val.split(","); int size = Integer.parseInt(parts[0]); int count = Integer.parseInt(parts[1]); @@ -213,12 +213,12 @@ public class BrowserSocket } case "manythreads": { - String parts[] = val.split(","); + String[] parts = val.split(","); int threadCount = Integer.parseInt(parts[0]); int size = Integer.parseInt(parts[1]); int count = Integer.parseInt(parts[2]); - Thread threads[] = new Thread[threadCount]; + Thread[] threads = new Thread[threadCount]; // Setup threads for (int n = 0; n < threadCount; n++) @@ -263,9 +263,9 @@ public class BrowserSocket private void writeManyAsync(int size, int count) { - char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-|{}[]():".toCharArray(); + char[] letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-|{}[]():".toCharArray(); int lettersLen = letters.length; - char randomText[] = new char[size]; + char[] randomText = new char[size]; Random rand = new Random(42); for (int n = 0; n < count; n++) diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/AcceptHashTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/AcceptHashTest.java index cf408c445c2..6eb5e7440bf 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/AcceptHashTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/AcceptHashTest.java @@ -34,7 +34,7 @@ public class AcceptHashTest { private static String hexAsKey(String hex) { - byte key[] = TypeUtil.fromHexString(hex); + byte[] key = TypeUtil.fromHexString(hex); assertThat("Key size of hex:[" + hex + "]", key.length, is(16)); return Base64.getEncoder().encodeToString(key); } diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/CloseStatusTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/CloseStatusTest.java index 6e17930c660..4dc70c9d5cf 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/CloseStatusTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/CloseStatusTest.java @@ -123,7 +123,7 @@ public class CloseStatusTest private ByteBuffer asByteBuffer(int statusCode, String reason) { int len = 2; // status code length - byte utf[] = null; + byte[] utf = null; if (StringUtil.isNotBlank(reason)) { utf = StringUtil.getUtf8Bytes(reason); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundtripTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundtripTest.java index 5cdb133f097..49177bf6db6 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundtripTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundtripTest.java @@ -85,7 +85,7 @@ public class GeneratorParserRoundtripTest Frame frame = new Frame(OpCode.TEXT).setPayload(message); // Add masking - byte mask[] = new byte[4]; + byte[] mask = new byte[4]; Arrays.fill(mask, (byte)0xFF); frame.setMask(mask); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java index 30f14d77683..e168b4f3b6b 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java @@ -444,7 +444,7 @@ public class GeneratorTest ByteBuffer actual = generate(close.toFrame()); ByteBuffer expected = ByteBuffer.allocate(132); - byte messageBytes[] = message.toString().getBytes(StandardCharsets.UTF_8); + byte[] messageBytes = message.toString().getBytes(StandardCharsets.UTF_8); expected.put(new byte[] {(byte)0x88}); @@ -507,7 +507,7 @@ public class GeneratorTest frames[pingCount] = CloseStatus.toFrame(CloseStatus.NORMAL); // Mask All Frames - byte maskingKey[] = Hex.asByteArray("11223344"); + byte[] maskingKey = Hex.asByteArray("11223344"); for (Frame f : frames) { f.setMask(maskingKey); @@ -520,7 +520,7 @@ public class GeneratorTest expected.append("8986").append("11223344"); expected.append(asMaskedHex("ping-1", maskingKey)); // ping 1 expected.append("8882").append("11223344"); - byte closure[] = Hex.asByteArray("03E8"); + byte[] closure = Hex.asByteArray("03E8"); mask(closure, maskingKey); expected.append(Hex.asHex(closure)); // normal closure @@ -756,7 +756,7 @@ public class GeneratorTest int dataSize = 256; Frame binary = new Frame(OpCode.BINARY); - byte payload[] = new byte[dataSize]; + byte[] payload = new byte[dataSize]; Arrays.fill(payload, (byte)0x44); binary.setPayload(ByteBuffer.wrap(payload)); @@ -791,7 +791,7 @@ public class GeneratorTest int dataSize = 1024 * 64; Frame binary = new Frame(OpCode.BINARY); - byte payload[] = new byte[dataSize]; + byte[] payload = new byte[dataSize]; Arrays.fill(payload, (byte)0x44); binary.setPayload(ByteBuffer.wrap(payload)); @@ -866,7 +866,7 @@ public class GeneratorTest public void testGenerate_Text_125BytePaylod() { int length = 125; - byte buf[] = new byte[length]; + byte[] buf = new byte[length]; Arrays.fill(buf, (byte)'*'); String text = new String(buf, StandardCharsets.UTF_8); @@ -1119,7 +1119,7 @@ public class GeneratorTest public void testGenerate_Text_Hello() { Frame frame = new Frame(OpCode.TEXT).setPayload("Hello"); - byte utf[] = StringUtil.getUtf8Bytes("Hello"); + byte[] utf = StringUtil.getUtf8Bytes("Hello"); assertGeneratedBytes("8105" + Hex.asHex(utf), frame); } @@ -1127,7 +1127,7 @@ public class GeneratorTest public void testGenerate_Text_Masked() { Frame frame = new Frame(OpCode.TEXT).setPayload("Hello"); - byte maskingKey[] = Hex.asByteArray("11223344"); + byte[] maskingKey = Hex.asByteArray("11223344"); frame.setMask(maskingKey); // what is expected @@ -1153,7 +1153,7 @@ public class GeneratorTest // payload does not start at position 0. LOG.debug("Payload = {}", BufferUtil.toDetailString(payload)); Frame frame = new Frame(OpCode.TEXT).setPayload(payload); - byte maskingKey[] = Hex.asByteArray("11223344"); + byte[] maskingKey = Hex.asByteArray("11223344"); frame.setMask(maskingKey); // what is expected @@ -1172,7 +1172,7 @@ public class GeneratorTest public void testGenerate_Windowed() { // A decent sized frame, no masking - byte payload[] = new byte[10240]; + byte[] payload = new byte[10240]; Arrays.fill(payload, (byte)0x44); Frame frame = new Frame(OpCode.BINARY).setPayload(payload); @@ -1200,10 +1200,10 @@ public class GeneratorTest public void testGenerate_WithMasking() throws Exception { // A decent sized frame, with masking - byte payload[] = new byte[10240]; + byte[] payload = new byte[10240]; Arrays.fill(payload, (byte)0x55); - byte mask[] = new byte[] + byte[] mask = new byte[] {0x2A, (byte)0xF0, 0x0F, 0x00}; Frame frame = new Frame(OpCode.BINARY).setPayload(payload); @@ -1308,7 +1308,7 @@ public class GeneratorTest private String asMaskedHex(String str, byte[] maskingKey) { - byte utf[] = StringUtil.getUtf8Bytes(str); + byte[] utf = StringUtil.getUtf8Bytes(str); mask(utf, maskingKey); return Hex.asHex(utf); } diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParsePayloadLengthTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParsePayloadLengthTest.java index 1084537066f..fd5693a4bee 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParsePayloadLengthTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParsePayloadLengthTest.java @@ -69,7 +69,7 @@ public class ParsePayloadLengthTest // Create text frame RawFrameBuilder.putOpFin(raw, OpCode.TEXT, true); RawFrameBuilder.putLength(raw, size, false); // len of closeCode - byte payload[] = new byte[size]; + byte[] payload = new byte[size]; Arrays.fill(payload, (byte)'x'); raw.put(payload); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java index 6e534668180..119250d3378 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java @@ -147,7 +147,7 @@ public class ParserReservedBitTest @Test public void testCase3_5() { - byte payload[] = new byte[8]; + byte[] payload = new byte[8]; Arrays.fill(payload, (byte)0xFF); List send = new ArrayList<>(); @@ -167,7 +167,7 @@ public class ParserReservedBitTest @Test public void testCase3_6() { - byte payload[] = new byte[8]; + byte[] payload = new byte[8]; Arrays.fill(payload, (byte)0xFF); List send = new ArrayList<>(); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserTest.java index a72e64c11de..f1eac07f18f 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserTest.java @@ -470,13 +470,13 @@ public class ParserTest public void testParse_Continuation_ManySmall() { String utf8 = "Hello-\uC2B5@\uC39F\uC3A4\uC3BC\uC3A0\uC3A1-UTF-8!!"; - byte msg[] = StringUtil.getUtf8Bytes(utf8); + byte[] msg = StringUtil.getUtf8Bytes(utf8); List send = new ArrayList<>(); int textCount = 0; int continuationCount = 0; int len = msg.length; - byte mini[]; + byte[] mini; for (int i = 0; i < len; i++) { Frame frame; @@ -1287,7 +1287,7 @@ public class ParserTest // Artificially small buffer/payload final int maxAllowedFrameSize = 1024; - byte utf[] = new byte[2048]; + byte[] utf = new byte[2048]; Arrays.fill(utf, (byte)'a'); assertThat("Must be a medium length payload", utf.length, allOf(greaterThan(0x7E), lessThan(0xFFFF))); @@ -1317,7 +1317,7 @@ public class ParserTest sb.append(". The end."); String expectedText = sb.toString(); - byte utf[] = expectedText.getBytes(StandardCharsets.UTF_8); + byte[] utf = expectedText.getBytes(StandardCharsets.UTF_8); assertThat("Must be a long length payload", utf.length, greaterThan(0xFFFF)); @@ -1340,7 +1340,7 @@ public class ParserTest public void testParse_Text_ManySmallBuffers_NoAutoFragmentation() throws InterruptedException { // Create frames - byte payload[] = new byte[65536]; + byte[] payload = new byte[65536]; Arrays.fill(payload, (byte)'*'); List frames = new ArrayList<>(); @@ -1389,7 +1389,7 @@ public class ParserTest sb.append(". The end."); String expectedText = sb.toString(); - byte utf[] = expectedText.getBytes(StandardCharsets.UTF_8); + byte[] utf = expectedText.getBytes(StandardCharsets.UTF_8); assertThat("Must be a medium length payload", utf.length, allOf(greaterThan(0x7E), lessThan(0xFFFF))); @@ -1412,7 +1412,7 @@ public class ParserTest public void testParse_Text_ShortMasked() throws Exception { String expectedText = "Hello World"; - byte utf[] = expectedText.getBytes(StandardCharsets.UTF_8); + byte[] utf = expectedText.getBytes(StandardCharsets.UTF_8); ByteBuffer buf = ByteBuffer.allocate(24); buf.put((byte)0x81); @@ -1468,7 +1468,7 @@ public class ParserTest { String expectedText = "Hell\uFF4f W\uFF4Frld"; - byte utf[] = expectedText.getBytes(StandardCharsets.UTF_8); + byte[] utf = expectedText.getBytes(StandardCharsets.UTF_8); ByteBuffer buf = ByteBuffer.allocate(24); buf.put((byte)0x81); diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/DeflateFrameExtensionTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/DeflateFrameExtensionTest.java index 04f3f337ae1..6da52cbe9a2 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/DeflateFrameExtensionTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/DeflateFrameExtensionTest.java @@ -217,7 +217,7 @@ public class DeflateFrameExtensionTest extends AbstractExtensionTest public void testCompress_TimeTimeTime() { // What pywebsocket produces for "time:", "time:", "time:" - String expected[] = new String[] + String[] expected = new String[] {"2AC9CC4DB50200", "2A01110000", "02130000"}; // Lets see what we produce @@ -250,7 +250,7 @@ public class DeflateFrameExtensionTest extends AbstractExtensionTest // Text to compress String text = "info:"; - byte uncompressed[] = StringUtil.getUtf8Bytes(text); + byte[] uncompressed = StringUtil.getUtf8Bytes(text); // Prime the compressor compressor.reset(); @@ -263,7 +263,7 @@ public class DeflateFrameExtensionTest extends AbstractExtensionTest while (!compressor.finished()) { - byte out[] = new byte[64]; + byte[] out = new byte[64]; int len = compressor.deflate(out, 0, out.length, Deflater.SYNC_FLUSH); if (len > 0) { @@ -273,7 +273,7 @@ public class DeflateFrameExtensionTest extends AbstractExtensionTest compressor.end(); BufferUtil.flipToFlush(outbuf, 0); - byte compressed[] = BufferUtil.toArray(outbuf); + byte[] compressed = BufferUtil.toArray(outbuf); // Clear the BFINAL bit that has been set by the compressor.end() call. // In the real implementation we never end() the compressor. compressed[0] &= 0xFE; @@ -305,14 +305,14 @@ public class DeflateFrameExtensionTest extends AbstractExtensionTest public void testInflateBasics() throws Exception { // should result in "info:" text if properly inflated - byte rawbuf[] = TypeUtil.fromHexString("CaCc4bCbB70200"); // what pywebsocket produces - // byte rawbuf[] = TypeUtil.fromHexString("CbCc4bCbB70200"); // what java produces + byte[] rawbuf = TypeUtil.fromHexString("CaCc4bCbB70200"); // what pywebsocket produces + // byte[] rawbuf = TypeUtil.fromHexString("CbCc4bCbB70200"); // what java produces Inflater inflater = new Inflater(true); inflater.reset(); inflater.setInput(rawbuf, 0, rawbuf.length); - byte outbuf[] = new byte[64]; + byte[] outbuf = new byte[64]; int len = inflater.inflate(outbuf); inflater.end(); assertThat("Inflated length", len, greaterThan(4)); @@ -325,7 +325,7 @@ public class DeflateFrameExtensionTest extends AbstractExtensionTest public void testPyWebSocketServer_Hello() { // Captured from PyWebSocket - "Hello" (echo from server) - byte rawbuf[] = TypeUtil.fromHexString("c107f248cdc9c90700"); + byte[] rawbuf = TypeUtil.fromHexString("c107f248cdc9c90700"); assertIncoming(rawbuf, "Hello"); } @@ -333,7 +333,7 @@ public class DeflateFrameExtensionTest extends AbstractExtensionTest public void testPyWebSocketServer_Long() { // Captured from PyWebSocket - Long Text (echo from server) - byte rawbuf[] = TypeUtil.fromHexString("c1421cca410a80300c44d1abccce9df7" + "f018298634d05631138ab7b7b8fdef1f" + "dc0282e2061d575a45f6f2686bab25e1" + byte[] rawbuf = TypeUtil.fromHexString("c1421cca410a80300c44d1abccce9df7" + "f018298634d05631138ab7b7b8fdef1f" + "dc0282e2061d575a45f6f2686bab25e1" + "3fb7296fa02b5885eb3b0379c394f461" + "98cafd03"); assertIncoming(rawbuf, "It's a big enough umbrella but it's always me that ends up getting wet."); } @@ -342,7 +342,7 @@ public class DeflateFrameExtensionTest extends AbstractExtensionTest public void testPyWebSocketServer_Medium() { // Captured from PyWebSocket - "stackoverflow" (echo from server) - byte rawbuf[] = TypeUtil.fromHexString("c10f2a2e494ccece2f4b2d4acbc92f0700"); + byte[] rawbuf = TypeUtil.fromHexString("c10f2a2e494ccece2f4b2d4acbc92f0700"); assertIncoming(rawbuf, "stackoverflow"); } diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionConfigTest.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionConfigTest.java index 373496e1679..20bbac1a2f3 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionConfigTest.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionConfigTest.java @@ -127,7 +127,7 @@ public class ExtensionConfigTest @Test public void testParseList_Simple() { - String rawHeaders[] = new String[]{ + String[] rawHeaders = new String[]{ "permessage-compress; client_max_window_bits", "capture; output=\"wscapture.log\"", "identity" @@ -147,7 +147,7 @@ public class ExtensionConfigTest @Test public void testParseList_Unsplit() { - String rawHeaders[] = new String[]{ + String[] rawHeaders = new String[]{ "permessage-compress; client_max_window_bits, identity", "capture; output=\"wscapture.log\"" }; diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java index 4d32ce5c214..adb912a9f8f 100644 --- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java +++ b/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java @@ -83,7 +83,7 @@ public class ExtensionTool public void parseIncomingHex(String... rawhex) { int parts = rawhex.length; - byte net[]; + byte[] net; for (int i = 0; i < parts; i++) { @@ -105,7 +105,7 @@ public class ExtensionTool public void assertHasFrames(String... textFrames) { - Frame frames[] = new Frame[textFrames.length]; + Frame[] frames = new Frame[textFrames.length]; for (int i = 0; i < frames.length; i++) { frames[i] = new Frame(OpCode.TEXT).setPayload(textFrames[i]); diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/java/com/acme/test/MultiPartTest.java b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/java/com/acme/test/MultiPartTest.java index 1984ac1efda..95c4dcc5286 100644 --- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/java/com/acme/test/MultiPartTest.java +++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/src/main/java/com/acme/test/MultiPartTest.java @@ -115,7 +115,7 @@ public class MultiPartTest extends HttpServlet throws IOException { int bufferSize = 8192; - byte buffer[] = new byte[bufferSize]; + byte[] buffer = new byte[bufferSize]; while (true) {