Make a member field final wherever possible

This commit is contained in:
Trustin Lee 2012-11-12 09:43:54 +09:00
parent d23766fa27
commit 2fe3e495c1
9 changed files with 23 additions and 23 deletions

View File

@ -35,7 +35,7 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
/**
* Proposed default MINSIZE as 16 KB.
*/
public static long MINSIZE = 0x4000;
public static final long MINSIZE = 0x4000;
private final boolean useDisk;

View File

@ -29,9 +29,9 @@ public class DiskAttribute extends AbstractDiskHttpData implements Attribute {
public static boolean deleteOnExitTemporaryFile = true;
public static String prefix = "Attr_";
public static final String prefix = "Attr_";
public static String postfix = ".att";
public static final String postfix = ".att";
/**
* Constructor used for huge Attribute

View File

@ -28,9 +28,9 @@ public class DiskFileUpload extends AbstractDiskHttpData implements FileUpload {
public static boolean deleteOnExitTemporaryFile = true;
public static String prefix = "FUp_";
public static final String prefix = "FUp_";
public static String postfix = ".tmp";
public static final String postfix = ".tmp";
private String filename;

View File

@ -25,7 +25,7 @@ import java.nio.charset.Charset;
*/
final class HttpPostBodyUtil {
public static int chunkSize = 8096;
public static final int chunkSize = 8096;
/**
* HTTP content disposition header name.
*/

View File

@ -23,7 +23,7 @@ import java.util.List;
* (like Multipart Mixed mode)
*/
public class InternalAttribute implements InterfaceHttpData {
protected List<String> value = new ArrayList<String>();
protected final List<String> value = new ArrayList<String>();
public HttpDataType getHttpDataType() {
return HttpDataType.InternalAttribute;

View File

@ -15,9 +15,6 @@
*/
package org.jboss.netty.handler.traffic;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelHandlerContext;
@ -34,6 +31,9 @@ import org.jboss.netty.util.Timeout;
import org.jboss.netty.util.Timer;
import org.jboss.netty.util.TimerTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
/**
* AbstractTrafficShapingHandler allows to limit the global bandwidth
* (see {@link GlobalTrafficShapingHandler}) or per session
@ -318,7 +318,7 @@ public abstract class AbstractTrafficShapingHandler extends
* Class to implement setReadable at fix time
*/
private class ReopenReadTimerTask implements TimerTask {
ChannelHandlerContext ctx;
final ChannelHandlerContext ctx;
ReopenReadTimerTask(ChannelHandlerContext ctx) {
this.ctx = ctx;
}

View File

@ -87,7 +87,7 @@ public class TrafficCounter {
/**
* Delay between two captures
*/
AtomicLong checkInterval = new AtomicLong(
final AtomicLong checkInterval = new AtomicLong(
AbstractTrafficShapingHandler.DEFAULT_CHECK_INTERVAL);
// default 1 s
@ -118,7 +118,7 @@ public class TrafficCounter {
/**
* Is Monitor active
*/
AtomicBoolean monitorActive = new AtomicBoolean();
final AtomicBoolean monitorActive = new AtomicBoolean();
/**
* Class to implement monitoring at fix delay

View File

@ -79,7 +79,7 @@ public class VirtualExecutorService extends AbstractExecutorService {
private final ExecutorService s;
final Object startStopLock = new Object();
volatile boolean shutdown;
Set<Thread> activeThreads = new MapBackedSet<Thread>(new IdentityHashMap<Thread, Boolean>());
final Set<Thread> activeThreads = new MapBackedSet<Thread>(new IdentityHashMap<Thread, Boolean>());
/**
* Creates a new instance with the specified parent {@link Executor}.

View File

@ -194,22 +194,22 @@ final class Deflate {
int good_match;
// Stop searching when current match exceeds this
int nice_match;
short[] dyn_ltree; // literal and length tree
short[] dyn_dtree; // distance tree
short[] bl_tree; // Huffman tree for bit lengths
Tree l_desc = new Tree(); // desc for literal tree
Tree d_desc = new Tree(); // desc for distance tree
Tree bl_desc = new Tree(); // desc for bit length tree
final short[] dyn_ltree; // literal and length tree
final short[] dyn_dtree; // distance tree
final short[] bl_tree; // Huffman tree for bit lengths
final Tree l_desc = new Tree(); // desc for literal tree
final Tree d_desc = new Tree(); // desc for distance tree
final Tree bl_desc = new Tree(); // desc for bit length tree
// number of codes at each bit length for an optimal tree
short[] bl_count = new short[JZlib.MAX_BITS + 1];
final short[] bl_count = new short[JZlib.MAX_BITS + 1];
// heap used to build the Huffman trees
int[] heap = new int[2 * JZlib.L_CODES + 1];
final int[] heap = new int[2 * JZlib.L_CODES + 1];
int heap_len; // number of elements in the heap
int heap_max; // element of largest frequency
// The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
// The same heap array is used to build all trees.
// Depth of each subtree used as tie breaker for trees of equal frequency
byte[] depth = new byte[2 * JZlib.L_CODES + 1];
final byte[] depth = new byte[2 * JZlib.L_CODES + 1];
int l_buf; // index for literals or lengths */
// Size of match buffer for literals/lengths. There are 4 reasons for
// limiting lit_bufsize to 64K: