Made row classes fields final.

This commit is contained in:
Robin Kupper
2011-04-20 01:26:00 +02:00
parent 0e28e66c07
commit 07bf348083

View File

@@ -91,11 +91,9 @@ public class Consumer extends TimerTask implements Runnable
return; return;
if (playerName.length() > 32) if (playerName.length() > 32)
playerName = playerName.substring(0, 32); playerName = playerName.substring(0, 32);
BlockRow row = new BlockRow(table, playerName, typeBefore, typeAfter, data, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
if (signtext != null) if (signtext != null)
row.signtext = signtext.replace("\\", "\\\\").replace("'", "\\'"); signtext = signtext.replace("\\", "\\\\").replace("'", "\\'");
if (ca != null) BlockRow row = new BlockRow(table, playerName, typeBefore, typeAfter, data, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), signtext, ca);
row.ca = ca;
if (!bqueue.offer(row)) if (!bqueue.offer(row))
log.info("[LogBlock] Failed to queue block for " + playerName); log.info("[LogBlock] Failed to queue block for " + playerName);
} }
@@ -215,15 +213,15 @@ public class Consumer extends TimerTask implements Runnable
private class BlockRow private class BlockRow
{ {
public String table; public final String table;
public String name; public final String name;
public int replaced, type; public final int replaced, type;
public byte data; public final byte data;
public int x, y, z; public final int x, y, z;
public String signtext; public final String signtext;
public ChestAccess ca; public final ChestAccess ca;
BlockRow(String table, String name, int replaced, int type, byte data, int x, int y, int z) { BlockRow(String table, String name, int replaced, int type, byte data, int x, int y, int z, String signtext, ChestAccess ca) {
this.table = table; this.table = table;
this.name = name; this.name = name;
this.replaced = replaced; this.replaced = replaced;
@@ -232,17 +230,17 @@ public class Consumer extends TimerTask implements Runnable
this.x = x; this.x = x;
this.y = y; this.y = y;
this.z = z; this.z = z;
this.signtext = null; this.signtext = signtext;
this.ca = null; this.ca = ca;
} }
} }
private class KillRow private class KillRow
{ {
public String table; public final String table;
public String killer; public final String killer;
public String victim; public final String victim;
public int weapon; public final int weapon;
KillRow(String table, String attacker, String defender, int weapon) { KillRow(String table, String attacker, String defender, int weapon) {
this.table = table; this.table = table;