Skip to content

Commit

Permalink
[RESTEASY-1974] Checkstyle - Array brackets at illegal position
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Terem authored and asoldano committed Nov 16, 2018
1 parent 26359c9 commit dcaa9ec
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ServerCacheInterceptor(final ServerCache cache)
protected Request validation;


private static final String pseudo[] = {
private static final String[] pseudo = {
"0", "1", "2",
"3", "4", "5", "6", "7", "8",
"9", "A", "B", "C", "D", "E",
Expand Down Expand Up @@ -79,7 +79,7 @@ protected String createHash(byte[] entity)
try
{
MessageDigest messagedigest = MessageDigest.getInstance("MD5");
byte abyte0[] = messagedigest.digest(entity);
byte[] abyte0 = messagedigest.digest(entity);
return byteArrayToHexString(abyte0);
}
catch (NoSuchAlgorithmException e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ public int read() throws IOException
return checkEOF(super.read());
}

public int read(byte b[]) throws IOException
public int read(byte[] b) throws IOException
{
return checkEOF(super.read(b));
}

public int read(byte b[], int off, int len) throws IOException
public int read(byte[] b, int off, int len) throws IOException
{
return checkEOF(super.read(b, off, len));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static long createHash(String methodDesc)
DataOutputStream dataoutputstream = new DataOutputStream(new DigestOutputStream(bytearrayoutputstream, messagedigest));
dataoutputstream.writeUTF(methodDesc);
dataoutputstream.flush();
byte abyte0[] = messagedigest.digest();
byte[] abyte0 = messagedigest.digest();
for (int j = 0; j < Math.min(8, abyte0.length); j++)
hash += (long) (abyte0[j] & 0xff) << j * 8;
return hash;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public static long createHash(String methodDesc)
DataOutputStream dataoutputstream = new DataOutputStream(new DigestOutputStream(bytearrayoutputstream, messagedigest));
dataoutputstream.writeUTF(methodDesc);
dataoutputstream.flush();
byte abyte0[] = messagedigest.digest();
byte[] abyte0 = messagedigest.digest();
for (int j = 0; j < Math.min(8, abyte0.length); j++)
hash += (long) (abyte0[j] & 0xff) << j * 8;
return hash;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ public static List<Cookie> parseCookies(String cookieHeader) {
String cookieName = null;
String cookieValue = null;

String parts[] = cookieHeader.split("[;,]");
String[] parts = cookieHeader.split("[;,]");
for (String part : parts)
{
String nv[] = part.split("=", 2);
String[] nv = part.split("=", 2);
String name = nv.length > 0 ? nv[0].trim() : "";
String value = nv.length > 1 ? nv[1].trim() : "";
if (value.startsWith("\"") && value.endsWith("\"") && value.length() > 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static long createHash(String methodDesc)
DataOutputStream dataoutputstream = new DataOutputStream(new DigestOutputStream(bytearrayoutputstream, messagedigest));
dataoutputstream.writeUTF(methodDesc);
dataoutputstream.flush();
byte abyte0[] = messagedigest.digest();
byte[] abyte0 = messagedigest.digest();
for (int j = 0; j < Math.min(8, abyte0.length); j++)
hash += (long) (abyte0[j] & 0xff) << j * 8;
return hash;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static void stop() throws Exception
netty = null;
}

public static void main(String args[]) throws Exception {
public static void main(String[] args) throws Exception {
start();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static void stop() throws Exception
netty = null;
}

public static void main(String args[]) throws Exception {
public static void main(String[] args) throws Exception {
start();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static void stop() throws Exception
vertx = null;
}

public static void main(String args[]) throws Exception {
public static void main(String[] args) throws Exception {
start();
}
}
6 changes: 3 additions & 3 deletions tjws/src/main/java/Acme/Serve/CgiServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void serveFile(HttpServletRequest req, HttpServletResponse res, String p
log("running " + path + "?" + queryString);

// Make argument list.
String argList[] = (path + (queryString != null && queryString.indexOf("=") == -1 ? "+" + queryString : ""))
String[] argList = (path + (queryString != null && queryString.indexOf("=") == -1 ? "+" + queryString : ""))
.split("\\+"); /* 1.4 */

// Make environment list.
Expand Down Expand Up @@ -139,7 +139,7 @@ private void serveFile(HttpServletRequest req, HttpServletResponse res, String p
value = "";
envVec.addElement(makeEnv("HTTP_" + name.toUpperCase().replace('-', '_'), value));
}
String envList[] = makeList(envVec);
String[] envList = makeList(envVec);

// Start the command.
Process proc = Runtime.getRuntime().exec(argList, envList);
Expand Down Expand Up @@ -274,7 +274,7 @@ private static String makeEnv(String name, String value)

private static String[] makeList(Vector vec)
{
String list[] = new String[vec.size()];
String[] list = new String[vec.size()];
for (int i = 0; i < vec.size(); ++i)
list[i] = (String) vec.elementAt(i);
return list;
Expand Down
2 changes: 1 addition & 1 deletion tjws/src/main/java/Acme/Serve/SSLAcceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ protected void initServerSocket(ServerSocket ssocket, boolean clientAuth)
SSLServerSocket socket = (SSLServerSocket) ssocket;

// Enable all available cipher suites when the socket is connected
String cipherSuites[] = socket.getSupportedCipherSuites();
String[] cipherSuites = socket.getSupportedCipherSuites();
socket.setEnabledCipherSuites(cipherSuites);
// Set client authentication if necessary
socket.setNeedClientAuth(clientAuth);
Expand Down
4 changes: 2 additions & 2 deletions tjws/src/main/java/Acme/Serve/Serve.java
Original file line number Diff line number Diff line change
Expand Up @@ -4521,13 +4521,13 @@ public int read() throws IOException
}

/* ------------------------------------------------------------ */
public int read(byte b[]) throws IOException
public int read(byte[] b) throws IOException
{
return read(b, 0, b.length);
}

/* ------------------------------------------------------------ */
public synchronized int read(byte b[], int off, int len) throws IOException
public synchronized int read(byte[] b, int off, int len) throws IOException
{
if (closed)
throw new IOException("The stream is already closed");
Expand Down
2 changes: 1 addition & 1 deletion tjws/src/main/java/Acme/Serve/ThrottledOutputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void write(int b) throws IOException
// @param off the start offset in the data
// @param len the number of bytes that are written
// @exception IOException if an I/O error has occurred
public void write(byte b[], int off, int len) throws IOException
public void write(byte[] b, int off, int len) throws IOException
{
// Check the throttle.
bytes += len;
Expand Down
2 changes: 1 addition & 1 deletion tjws/src/main/java/Acme/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ public static void copyStream(Reader in, OutputStream out, String charSet) throw
out.write(new String(buf, 0, len).getBytes(charSet));
}

protected static final char BASE64ARRAY[] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
protected static final char[] BASE64ARRAY = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3',
'4', '5', '6', '7', '8', '9', '+', '/'};
Expand Down

0 comments on commit dcaa9ec

Please sign in to comment.