Added missing final modifiers.
This commit is contained in:
@@ -57,13 +57,13 @@ public class DeadLockDetector extends Thread
|
||||
{
|
||||
try
|
||||
{
|
||||
long[] ids = tmx.findDeadlockedThreads();
|
||||
final long[] ids = tmx.findDeadlockedThreads();
|
||||
|
||||
if (ids != null)
|
||||
{
|
||||
deadlock = true;
|
||||
ThreadInfo[] tis = tmx.getThreadInfo(ids, true, true);
|
||||
StringBuilder info = new StringBuilder();
|
||||
final ThreadInfo[] tis = tmx.getThreadInfo(ids, true, true);
|
||||
final StringBuilder info = new StringBuilder();
|
||||
info.append("DeadLock Found!");
|
||||
info.append(Config.EOL);
|
||||
for (ThreadInfo ti : tis)
|
||||
@@ -73,8 +73,8 @@ public class DeadLockDetector extends Thread
|
||||
|
||||
for (ThreadInfo ti : tis)
|
||||
{
|
||||
LockInfo[] locks = ti.getLockedSynchronizers();
|
||||
MonitorInfo[] monitors = ti.getLockedMonitors();
|
||||
final LockInfo[] locks = ti.getLockedSynchronizers();
|
||||
final MonitorInfo[] monitors = ti.getLockedMonitors();
|
||||
if ((locks.length == 0) && (monitors.length == 0))
|
||||
{
|
||||
continue;
|
||||
|
@@ -27,7 +27,7 @@ public final class EnumIntBitmask<E extends Enum<E>> implements Cloneable
|
||||
public static <E extends Enum<E>> int getAllBitmask(Class<E> enumClass)
|
||||
{
|
||||
int allBitmask = 0;
|
||||
E[] values = enumClass.getEnumConstants();
|
||||
final E[] values = enumClass.getEnumConstants();
|
||||
if (values.length > 32)
|
||||
{
|
||||
throw new IllegalArgumentException("Enum too big for an integer bitmask.");
|
||||
@@ -46,7 +46,7 @@ public final class EnumIntBitmask<E extends Enum<E>> implements Cloneable
|
||||
{
|
||||
_enumClass = enumClass;
|
||||
|
||||
E[] values = _enumClass.getEnumConstants();
|
||||
final E[] values = _enumClass.getEnumConstants();
|
||||
if (values.length > 32)
|
||||
{
|
||||
throw new IllegalArgumentException("Enum too big for an integer bitmask.");
|
||||
|
@@ -248,7 +248,7 @@ public class HexUtils
|
||||
else if (dataLen < _HEX_ED_BPL)
|
||||
{
|
||||
// last line which shows less than _HEX_ED_BPL bytes
|
||||
int lineHexDataEnd = lineHexDataStart + (dataLen * _HEX_ED_CPB);
|
||||
final int lineHexDataEnd = lineHexDataStart + (dataLen * _HEX_ED_CPB);
|
||||
Arrays.fill(textData, lineHexDataEnd, lineHexDataEnd + ((_HEX_ED_BPL - dataLen) * _HEX_ED_CPB) + 1, ' '); // spaces, for the last line if there are not _HEX_ED_BPL bytes
|
||||
}
|
||||
else
|
||||
|
@@ -29,7 +29,7 @@ public class IPSubnet
|
||||
|
||||
public IPSubnet(String input) throws UnknownHostException, NumberFormatException, ArrayIndexOutOfBoundsException
|
||||
{
|
||||
int idx = input.indexOf("/");
|
||||
final int idx = input.indexOf("/");
|
||||
if (idx > 0)
|
||||
{
|
||||
_addr = InetAddress.getByName(input.substring(0, idx)).getAddress();
|
||||
|
@@ -41,7 +41,7 @@ public class IPv4Filter implements IAcceptFilter, Runnable
|
||||
public IPv4Filter()
|
||||
{
|
||||
_ipFloodMap = new HashMap<>();
|
||||
Thread t = new Thread(this, getClass().getSimpleName());
|
||||
final Thread t = new Thread(this, getClass().getSimpleName());
|
||||
t.setDaemon(true);
|
||||
t.start();
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class IPv4Filter implements IAcceptFilter, Runnable
|
||||
}
|
||||
|
||||
final int h = hash(addr.getAddress());
|
||||
long current = System.currentTimeMillis();
|
||||
final long current = System.currentTimeMillis();
|
||||
Flood f;
|
||||
synchronized (_ipFloodMap)
|
||||
{
|
||||
@@ -125,13 +125,13 @@ public class IPv4Filter implements IAcceptFilter, Runnable
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
long reference = System.currentTimeMillis() - (1000 * 300);
|
||||
final long reference = System.currentTimeMillis() - (1000 * 300);
|
||||
synchronized (_ipFloodMap)
|
||||
{
|
||||
Iterator<Entry<Integer, Flood>> it = _ipFloodMap.entrySet().iterator();
|
||||
final Iterator<Entry<Integer, Flood>> it = _ipFloodMap.entrySet().iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
Flood f = it.next().getValue();
|
||||
final Flood f = it.next().getValue();
|
||||
if (f.lastAccess < reference)
|
||||
{
|
||||
it.remove();
|
||||
|
@@ -65,13 +65,13 @@ public final class PropertiesParser
|
||||
|
||||
private String getValue(String key)
|
||||
{
|
||||
String value = _properties.getProperty(key);
|
||||
final String value = _properties.getProperty(key);
|
||||
return value != null ? value.trim() : null;
|
||||
}
|
||||
|
||||
public boolean getBoolean(String key, boolean defaultValue)
|
||||
{
|
||||
String value = getValue(key);
|
||||
final String value = getValue(key);
|
||||
if (value == null)
|
||||
{
|
||||
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
|
||||
@@ -95,7 +95,7 @@ public final class PropertiesParser
|
||||
|
||||
public byte getByte(String key, byte defaultValue)
|
||||
{
|
||||
String value = getValue(key);
|
||||
final String value = getValue(key);
|
||||
if (value == null)
|
||||
{
|
||||
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
|
||||
@@ -115,7 +115,7 @@ public final class PropertiesParser
|
||||
|
||||
public short getShort(String key, short defaultValue)
|
||||
{
|
||||
String value = getValue(key);
|
||||
final String value = getValue(key);
|
||||
if (value == null)
|
||||
{
|
||||
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
|
||||
@@ -135,7 +135,7 @@ public final class PropertiesParser
|
||||
|
||||
public int getInt(String key, int defaultValue)
|
||||
{
|
||||
String value = getValue(key);
|
||||
final String value = getValue(key);
|
||||
if (value == null)
|
||||
{
|
||||
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
|
||||
@@ -155,7 +155,7 @@ public final class PropertiesParser
|
||||
|
||||
public long getLong(String key, long defaultValue)
|
||||
{
|
||||
String value = getValue(key);
|
||||
final String value = getValue(key);
|
||||
if (value == null)
|
||||
{
|
||||
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
|
||||
@@ -175,7 +175,7 @@ public final class PropertiesParser
|
||||
|
||||
public float getFloat(String key, float defaultValue)
|
||||
{
|
||||
String value = getValue(key);
|
||||
final String value = getValue(key);
|
||||
if (value == null)
|
||||
{
|
||||
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
|
||||
@@ -195,7 +195,7 @@ public final class PropertiesParser
|
||||
|
||||
public double getDouble(String key, double defaultValue)
|
||||
{
|
||||
String value = getValue(key);
|
||||
final String value = getValue(key);
|
||||
if (value == null)
|
||||
{
|
||||
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
|
||||
@@ -215,7 +215,7 @@ public final class PropertiesParser
|
||||
|
||||
public String getString(String key, String defaultValue)
|
||||
{
|
||||
String value = getValue(key);
|
||||
final String value = getValue(key);
|
||||
if (value == null)
|
||||
{
|
||||
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
|
||||
@@ -226,7 +226,7 @@ public final class PropertiesParser
|
||||
|
||||
public <T extends Enum<T>> T getEnum(String key, Class<T> clazz, T defaultValue)
|
||||
{
|
||||
String value = getValue(key);
|
||||
final String value = getValue(key);
|
||||
if (value == null)
|
||||
{
|
||||
_log.warning("[" + _file.getName() + "] missing property for key: " + key + " using default value: " + defaultValue);
|
||||
|
@@ -198,7 +198,7 @@ public final class StringUtil
|
||||
public static String concat(final String... strings)
|
||||
{
|
||||
final StringBuilder sbString = new StringBuilder();
|
||||
for (final String string : strings)
|
||||
for (String string : strings)
|
||||
{
|
||||
sbString.append(string);
|
||||
}
|
||||
@@ -215,7 +215,7 @@ public final class StringUtil
|
||||
{
|
||||
final int length = getLength(strings);
|
||||
final StringBuilder sbString = new StringBuilder(sizeHint > length ? sizeHint : length);
|
||||
for (final String string : strings)
|
||||
for (String string : strings)
|
||||
{
|
||||
sbString.append(string);
|
||||
}
|
||||
@@ -231,7 +231,7 @@ public final class StringUtil
|
||||
{
|
||||
sbString.ensureCapacity(sbString.length() + getLength(strings));
|
||||
|
||||
for (final String string : strings)
|
||||
for (String string : strings)
|
||||
{
|
||||
sbString.append(string);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public final class StringUtil
|
||||
public static int getLength(final Iterable<String> strings)
|
||||
{
|
||||
int length = 0;
|
||||
for (final String string : strings)
|
||||
for (String string : strings)
|
||||
{
|
||||
length += (string == null) ? 4 : string.length();
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public final class StringUtil
|
||||
public static int getLength(final String[] strings)
|
||||
{
|
||||
int length = 0;
|
||||
for (final String string : strings)
|
||||
for (String string : strings)
|
||||
{
|
||||
length += (string == null) ? 4 : string.length();
|
||||
}
|
||||
@@ -265,7 +265,7 @@ public final class StringUtil
|
||||
public static String getTraceString(StackTraceElement[] trace)
|
||||
{
|
||||
final StringBuilder sbString = new StringBuilder();
|
||||
for (final StackTraceElement element : trace)
|
||||
for (StackTraceElement element : trace)
|
||||
{
|
||||
sbString.append(element.toString()).append(Config.EOL);
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ public class TimeUtil
|
||||
}
|
||||
try
|
||||
{
|
||||
int val = Integer.parseInt(datePattern.substring(0, index));
|
||||
final int val = Integer.parseInt(datePattern.substring(0, index));
|
||||
final String type = datePattern.substring(index);
|
||||
final ChronoUnit unit;
|
||||
switch (type.toLowerCase())
|
||||
|
@@ -71,7 +71,7 @@ public final class Util
|
||||
{
|
||||
try
|
||||
{
|
||||
InetAddress addr = InetAddress.getByName(host);
|
||||
final InetAddress addr = InetAddress.getByName(host);
|
||||
return addr.isSiteLocalAddress() || addr.isLoopbackAddress();
|
||||
}
|
||||
catch (UnknownHostException e)
|
||||
@@ -111,9 +111,9 @@ public final class Util
|
||||
*/
|
||||
public static String printData(ByteBuffer buf)
|
||||
{
|
||||
byte[] data = new byte[buf.remaining()];
|
||||
final byte[] data = new byte[buf.remaining()];
|
||||
buf.get(data);
|
||||
String hex = Util.printData(data, data.length);
|
||||
final String hex = Util.printData(data, data.length);
|
||||
buf.position(buf.position() - data.length);
|
||||
return hex;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ public final class Util
|
||||
*/
|
||||
public static byte[] generateHex(int size)
|
||||
{
|
||||
byte[] array = new byte[size];
|
||||
final byte[] array = new byte[size];
|
||||
Rnd.nextBytes(array);
|
||||
return array;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public final class Util
|
||||
*/
|
||||
public static String getStackTrace(Throwable t)
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
final StringWriter sw = new StringWriter();
|
||||
t.printStackTrace(new PrintWriter(sw));
|
||||
return sw.toString();
|
||||
}
|
||||
|
@@ -1129,7 +1129,7 @@ public final class BlowfishEngine
|
||||
*/
|
||||
private void processTable(int xl, int xr, int[] table)
|
||||
{
|
||||
int size = table.length;
|
||||
final int size = table.length;
|
||||
for (int s = 0; s < size; s += 2)
|
||||
{
|
||||
xl ^= P[0];
|
||||
@@ -1174,7 +1174,7 @@ public final class BlowfishEngine
|
||||
* (2) Now, XOR P[0] with the first 32 bits of the key, XOR P[1] with the second 32-bits of the key, and so on for all bits of the key (up to P[17]).<br>
|
||||
* Repeatedly cycle through the key bits until the entire P-array has been XOR-ed with the key bits
|
||||
*/
|
||||
int keyLength = key.length;
|
||||
final int keyLength = key.length;
|
||||
int keyIndex = 0;
|
||||
for (int i = 0; i < P_SZ; i++)
|
||||
{
|
||||
|
@@ -71,7 +71,7 @@ public final class NewCrypt
|
||||
}
|
||||
|
||||
long chksum = 0;
|
||||
int count = size - 4;
|
||||
final int count = size - 4;
|
||||
long check = -1;
|
||||
int i;
|
||||
|
||||
@@ -111,7 +111,7 @@ public final class NewCrypt
|
||||
public static void appendChecksum(final byte[] raw, final int offset, final int size)
|
||||
{
|
||||
long chksum = 0;
|
||||
int count = size - 4;
|
||||
final int count = size - 4;
|
||||
long ecx;
|
||||
int i;
|
||||
|
||||
@@ -157,7 +157,7 @@ public final class NewCrypt
|
||||
*/
|
||||
static void encXORPass(byte[] raw, final int offset, final int size, int key)
|
||||
{
|
||||
int stop = size - 8;
|
||||
final int stop = size - 8;
|
||||
int pos = 4 + offset;
|
||||
int edx;
|
||||
int ecx = key; // Initial xor key
|
||||
|
@@ -44,14 +44,14 @@ public class ScrambledKeyPair
|
||||
|
||||
if ((scrambledMod.length == 0x81) && (scrambledMod[0] == 0x00))
|
||||
{
|
||||
byte[] temp = new byte[0x80];
|
||||
final byte[] temp = new byte[0x80];
|
||||
System.arraycopy(scrambledMod, 1, temp, 0, 0x80);
|
||||
scrambledMod = temp;
|
||||
}
|
||||
// step 1 : 0x4d-0x50 <-> 0x00-0x04
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
byte temp = scrambledMod[0x00 + i];
|
||||
final byte temp = scrambledMod[0x00 + i];
|
||||
scrambledMod[0x00 + i] = scrambledMod[0x4d + i];
|
||||
scrambledMod[0x4d + i] = temp;
|
||||
}
|
||||
|
@@ -48,7 +48,7 @@ public abstract class BaseRecievePacket
|
||||
|
||||
public int readC()
|
||||
{
|
||||
int result = _decrypt[_off++] & 0xff;
|
||||
final int result = _decrypt[_off++] & 0xff;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ public abstract class BaseRecievePacket
|
||||
|
||||
public final byte[] readB(int length)
|
||||
{
|
||||
byte[] result = new byte[length];
|
||||
final byte[] result = new byte[length];
|
||||
System.arraycopy(_decrypt, _off, result, 0, length);
|
||||
_off += length;
|
||||
return result;
|
||||
|
@@ -58,7 +58,7 @@ public abstract class BaseSendablePacket
|
||||
|
||||
protected void writeF(double org)
|
||||
{
|
||||
long value = Double.doubleToRawLongBits(org);
|
||||
final long value = Double.doubleToRawLongBits(org);
|
||||
_bao.write((int) (value & 0xff));
|
||||
_bao.write((int) ((value >> 8) & 0xff));
|
||||
_bao.write((int) ((value >> 16) & 0xff));
|
||||
@@ -123,7 +123,7 @@ public abstract class BaseSendablePacket
|
||||
|
||||
writeD(0x00); // reserve for checksum
|
||||
|
||||
int padding = _bao.size() % 8;
|
||||
final int padding = _bao.size() % 8;
|
||||
if (padding != 0)
|
||||
{
|
||||
for (int i = padding; i < 8; i++)
|
||||
|
Reference in New Issue
Block a user