From 5976d0048ddc66f2b695ba2c41c1a3ed3b08424d Mon Sep 17 00:00:00 2001 From: Stephane Bailliez Date: Sat, 26 Jan 2002 20:05:34 +0000 Subject: [PATCH] Fix array declarators git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270907 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/bzip2/BZip2Constants.java | 2 +- .../apache/tools/bzip2/CBZip2InputStream.java | 18 +++---- .../tools/bzip2/CBZip2OutputStream.java | 50 +++++++++---------- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/main/org/apache/tools/bzip2/BZip2Constants.java b/src/main/org/apache/tools/bzip2/BZip2Constants.java index 3a283d589..6e28d7acc 100644 --- a/src/main/org/apache/tools/bzip2/BZip2Constants.java +++ b/src/main/org/apache/tools/bzip2/BZip2Constants.java @@ -79,7 +79,7 @@ public interface BZip2Constants { int MAX_SELECTORS = (2 + (900000 / G_SIZE)); int NUM_OVERSHOOT_BYTES = 20; - int rNums[] = { + int[] rNums = { 619, 720, 127, 481, 931, 816, 813, 233, 566, 247, 985, 724, 205, 454, 863, 491, 741, 242, 949, 214, 733, 859, 335, 708, 621, 574, 73, 654, 730, 472, diff --git a/src/main/org/apache/tools/bzip2/CBZip2InputStream.java b/src/main/org/apache/tools/bzip2/CBZip2InputStream.java index 217968289..4bab47ccd 100644 --- a/src/main/org/apache/tools/bzip2/CBZip2InputStream.java +++ b/src/main/org/apache/tools/bzip2/CBZip2InputStream.java @@ -123,14 +123,14 @@ public class CBZip2InputStream extends InputStream implements BZip2Constants { private int bsLive; private CRC mCrc = new CRC(); - private boolean inUse[] = new boolean[256]; + private boolean[] inUse = new boolean[256]; private int nInUse; - private char seqToUnseq[] = new char[256]; - private char unseqToSeq[] = new char[256]; + private char[] seqToUnseq = new char[256]; + private char[] unseqToSeq = new char[256]; - private char selector[] = new char[MAX_SELECTORS]; - private char selectorMtf[] = new char[MAX_SELECTORS]; + private char[] selector = new char[MAX_SELECTORS]; + private char[] selectorMtf = new char[MAX_SELECTORS]; private int[] tt; private char[] ll8; @@ -400,7 +400,7 @@ public class CBZip2InputStream extends InputStream implements BZip2Constants { char len[][] = new char[N_GROUPS][MAX_ALPHA_SIZE]; int i, j, t, nGroups, nSelectors, alphaSize; int minLen, maxLen; - boolean inUse16[] = new boolean[16]; + boolean[] inUse16 = new boolean[16]; /* Receive the mapping table */ for (i = 0; i < 16; i++) { @@ -441,7 +441,7 @@ public class CBZip2InputStream extends InputStream implements BZip2Constants { /* Undo the MTF values for the selectors. */ { - char pos[] = new char[N_GROUPS]; + char[] pos = new char[N_GROUPS]; char tmp, v; for (v = 0; v < nGroups; v++) { pos[v] = v; @@ -493,7 +493,7 @@ public class CBZip2InputStream extends InputStream implements BZip2Constants { } private void getAndMoveToFrontDecode() { - char yy[] = new char[256]; + char[] yy = new char[256]; int i, j, nextSym, limitLast; int EOB, groupNo, groupPos; @@ -699,7 +699,7 @@ public class CBZip2InputStream extends InputStream implements BZip2Constants { } private void setupBlock() { - int cftab[] = new int[257]; + int[] cftab = new int[257]; char ch; cftab[0] = 0; diff --git a/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java b/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java index f19f08c74..09a695710 100644 --- a/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java +++ b/src/main/org/apache/tools/bzip2/CBZip2OutputStream.java @@ -115,9 +115,9 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { int nNodes, nHeap, n1, n2, i, j, k; boolean tooLong; - int heap[] = new int[MAX_ALPHA_SIZE + 2]; - int weight[] = new int[MAX_ALPHA_SIZE * 2]; - int parent[] = new int[MAX_ALPHA_SIZE * 2]; + int[] heap = new int[MAX_ALPHA_SIZE + 2]; + int[] weight = new int[MAX_ALPHA_SIZE * 2]; + int[] parent = new int[MAX_ALPHA_SIZE * 2]; for (i = 0; i < alphaSize; i++) { weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8; @@ -278,24 +278,24 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { int bsLive; CRC mCrc = new CRC(); - private boolean inUse[] = new boolean[256]; + private boolean[] inUse = new boolean[256]; private int nInUse; - private char seqToUnseq[] = new char[256]; - private char unseqToSeq[] = new char[256]; + private char[] seqToUnseq = new char[256]; + private char[] unseqToSeq = new char[256]; - private char selector[] = new char[MAX_SELECTORS]; - private char selectorMtf[] = new char[MAX_SELECTORS]; + private char[] selector = new char[MAX_SELECTORS]; + private char[] selectorMtf = new char[MAX_SELECTORS]; - private char block[]; - private int quadrant[]; - private int zptr[]; - private short szptr[]; - private int ftab[]; + private char[] block; + private int[] quadrant; + private int[] zptr; + private short[] szptr; + private int[] ftab; private int nMTF; - private int mtfFreq[] = new int[MAX_ALPHA_SIZE]; + private int[] mtfFreq = new int[MAX_ALPHA_SIZE]; /* * Used when sorting. If too many long comparisons @@ -668,9 +668,9 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { } } - int rfreq[][] = new int[N_GROUPS][MAX_ALPHA_SIZE]; - int fave[] = new int[N_GROUPS]; - short cost[] = new short[N_GROUPS]; + int[][] rfreq = new int[N_GROUPS][MAX_ALPHA_SIZE]; + int[] fave = new int[N_GROUPS]; + short[] cost = new short[N_GROUPS]; /* Iterate up to N_ITERS times to improve the tables. */ @@ -783,7 +783,7 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { /* Compute MTF values for the selectors. */ { - char pos[] = new char[N_GROUPS]; + char[] pos = new char[N_GROUPS]; char ll_i, tmp2, tmp; for (i = 0; i < nGroups; i++) { pos[i] = (char)i; @@ -803,7 +803,7 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { } } - int code[][] = new int[N_GROUPS][MAX_ALPHA_SIZE]; + int[][] code = new int[N_GROUPS][MAX_ALPHA_SIZE]; /* Assign actual codes for the tables. */ for (t = 0; t < nGroups; t++) { @@ -828,7 +828,7 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { /* Transmit the mapping table. */ { - boolean inUse16[] = new boolean[16]; + boolean[] inUse16 = new boolean[16]; for (i = 0; i < 16; i++) { inUse16[i] = false; for (j = 0; j < 16; j++) { @@ -1160,9 +1160,9 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { private void mainSort() { int i, j, ss, sb; - int runningOrder[] = new int[256]; - int copy[] = new int[256]; - boolean bigDone[] = new boolean[256]; + int[] runningOrder = new int[256]; + int[] copy = new int[256]; + boolean[] bigDone = new boolean[256]; int c1, c2; int numQSorted; @@ -1539,7 +1539,7 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { because the number of elems to sort is usually small, typically <= 20. */ - private int incs[] = { 1, 4, 13, 40, 121, 364, 1093, 3280, + private int[] incs = { 1, 4, 13, 40, 121, 364, 1093, 3280, 9841, 29524, 88573, 265720, 797161, 2391484 }; @@ -1573,7 +1573,7 @@ public class CBZip2OutputStream extends OutputStream implements BZip2Constants { } private void generateMTFValues() { - char yy[] = new char[256]; + char[] yy = new char[256]; int i, j; char tmp; char tmp2;