Added missing final modifiers.

This commit is contained in:
MobiusDev
2015-12-26 12:03:36 +00:00
parent cc92e5d062
commit e0d681a17e
974 changed files with 5919 additions and 5917 deletions

View File

@@ -43,7 +43,7 @@ public class Buy implements IBypassHandler
try
{
StringTokenizer st = new StringTokenizer(command, " ");
final StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
if (st.countTokens() < 1)

View File

@@ -48,7 +48,7 @@ public class Freight implements IBypassHandler
if (command.equalsIgnoreCase(COMMANDS[0]))
{
PcFreight freight = activeChar.getFreight();
final PcFreight freight = activeChar.getFreight();
if (freight != null)
{
if (freight.getSize() > 0)

View File

@@ -64,14 +64,14 @@ public class ItemAuctionLink implements IBypassHandler
try
{
StringTokenizer st = new StringTokenizer(command);
final StringTokenizer st = new StringTokenizer(command);
st.nextToken(); // bypass "ItemAuction"
if (!st.hasMoreTokens())
{
return false;
}
String cmd = st.nextToken();
final String cmd = st.nextToken();
if ("show".equalsIgnoreCase(cmd))
{
if (!activeChar.getFloodProtectors().getItemAuction().tryPerformAction("RequestInfoItemAuction"))
@@ -104,7 +104,7 @@ public class ItemAuctionLink implements IBypassHandler
{
final ItemAuction[] auctions = au.getAuctionsByBidder(activeChar.getObjectId());
boolean returned = false;
for (final ItemAuction auction : auctions)
for (ItemAuction auction : auctions)
{
if (auction.cancelBid(activeChar))
{

View File

@@ -33,7 +33,7 @@ public class Link implements IBypassHandler
@Override
public boolean useBypass(String command, L2PcInstance activeChar, L2Character target)
{
String htmlPath = command.substring(4).trim();
final String htmlPath = command.substring(4).trim();
if (htmlPath.isEmpty())
{
_log.warning("Player " + activeChar.getName() + " sent empty link html!");
@@ -46,7 +46,7 @@ public class Link implements IBypassHandler
return false;
}
String filename = "html/" + htmlPath;
final String filename = "html/" + htmlPath;
final NpcHtmlMessage html = new NpcHtmlMessage(target != null ? target.getObjectId() : 0);
html.setFile(activeChar.getHtmlPrefix(), filename);
html.replace("%objectId%", String.valueOf(target != null ? target.getObjectId() : 0));

View File

@@ -93,7 +93,7 @@ public class Loto implements IBypassHandler
// >24 - check lottery ticket by item object id
public static final void showLotoWindow(L2PcInstance player, L2Npc npc, int val)
{
int npcId = npc.getTemplate().getId();
final int npcId = npc.getTemplate().getId();
String filename;
SystemMessage sm;
final NpcHtmlMessage html = new NpcHtmlMessage(npc.getObjectId());
@@ -163,16 +163,16 @@ public class Loto implements IBypassHandler
{
button = "0" + button;
}
String search = "fore=\"L2UI.lottoNum" + button + "\" back=\"L2UI.lottoNum" + button + "a_check\"";
String replace = "fore=\"L2UI.lottoNum" + button + "a_check\" back=\"L2UI.lottoNum" + button + "\"";
final String search = "fore=\"L2UI.lottoNum" + button + "\" back=\"L2UI.lottoNum" + button + "a_check\"";
final String replace = "fore=\"L2UI.lottoNum" + button + "a_check\" back=\"L2UI.lottoNum" + button + "\"";
html.replace(search, replace);
}
}
if (count == 5)
{
String search = "0\">Return";
String replace = "22\">Your lucky numbers have been selected above.";
final String search = "0\">Return";
final String replace = "22\">Your lucky numbers have been selected above.";
html.replace(search, replace);
}
}
@@ -191,8 +191,8 @@ public class Loto implements IBypassHandler
return;
}
long price = Config.ALT_LOTTERY_TICKET_PRICE;
int lotonumber = Lottery.getInstance().getId();
final long price = Config.ALT_LOTTERY_TICKET_PRICE;
final int lotonumber = Lottery.getInstance().getId();
int enchant = 0;
int type2 = 0;
@@ -228,16 +228,16 @@ public class Loto implements IBypassHandler
sm.addItemName(4442);
player.sendPacket(sm);
L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), 4442);
final L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), 4442);
item.setCount(1);
item.setCustomType1(lotonumber);
item.setEnchantLevel(enchant);
item.setCustomType2(type2);
player.getInventory().addItem("Loto", item, player, npc);
InventoryUpdate iu = new InventoryUpdate();
final InventoryUpdate iu = new InventoryUpdate();
iu.addItem(item);
L2ItemInstance adenaupdate = player.getInventory().getItemByItemId(57);
final L2ItemInstance adenaupdate = player.getInventory().getItemByItemId(57);
iu.addModifiedItem(adenaupdate);
player.sendPacket(iu);
@@ -254,7 +254,7 @@ public class Loto implements IBypassHandler
filename = (npc.getHtmlPath(npcId, 4));
html.setFile(player.getHtmlPrefix(), filename);
int lotonumber = Lottery.getInstance().getId();
final int lotonumber = Lottery.getInstance().getId();
String message = "";
for (L2ItemInstance item : player.getInventory().getItems())
{
@@ -265,12 +265,12 @@ public class Loto implements IBypassHandler
if ((item.getId() == 4442) && (item.getCustomType1() < lotonumber))
{
message = message + "<a action=\"bypass -h npc_%objectId%_Loto " + item.getObjectId() + "\">" + item.getCustomType1() + " Event Number ";
int[] numbers = Lottery.getInstance().decodeNumbers(item.getEnchantLevel(), item.getCustomType2());
final int[] numbers = Lottery.getInstance().decodeNumbers(item.getEnchantLevel(), item.getCustomType2());
for (int i = 0; i < 5; i++)
{
message += numbers[i] + " ";
}
long[] check = Lottery.getInstance().checkTicket(item);
final long[] check = Lottery.getInstance().checkTicket(item);
if (check[0] > 0)
{
switch ((int) check[0])
@@ -306,19 +306,19 @@ public class Loto implements IBypassHandler
}
else if (val > 25) // >25 - check lottery ticket by item object id
{
int lotonumber = Lottery.getInstance().getId();
L2ItemInstance item = player.getInventory().getItemByObjectId(val);
final int lotonumber = Lottery.getInstance().getId();
final L2ItemInstance item = player.getInventory().getItemByObjectId(val);
if ((item == null) || (item.getId() != 4442) || (item.getCustomType1() >= lotonumber))
{
return;
}
long[] check = Lottery.getInstance().checkTicket(item);
final long[] check = Lottery.getInstance().checkTicket(item);
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
sm.addItemName(4442);
player.sendPacket(sm);
long adena = check[1];
final long adena = check[1];
if (adena > 0)
{
player.addAdena("Loto", adena, npc, true);

View File

@@ -302,7 +302,7 @@ public class NpcViewMod implements IBypassHandler
}
else
{
GroupedGeneralDropItem normalized = generalGroupedDropItem.normalizeMe(npc, activeChar);
final GroupedGeneralDropItem normalized = generalGroupedDropItem.normalizeMe(npc, activeChar);
sb.append("<table width=332 cellpadding=2 cellspacing=0 background=\"L2UI_CT1.Windows.Windows_DF_TooltipBG\">");
sb.append("<tr><td width=32 valign=top><img src=\"L2UI_CT1.ICON_DF_premiumItem\" width=32 height=32></td>");
sb.append("<td fixwidth=300 align=center><font name=\"ScreenMessageSmall\" color=\"CD9000\">One from group</font>");
@@ -327,7 +327,7 @@ public class NpcViewMod implements IBypassHandler
sb.append(item.getName());
sb.append("</font></td></tr><tr><td width=32></td><td width=259><table width=253 cellpadding=0 cellspacing=0>");
sb.append("<tr><td width=48 align=right valign=top><font color=\"LEVEL\">Amount:</font></td><td width=205 align=center>");
MinMax minMax = getPreciseMinMax(normalized.getChance(), generalDropItem.getMin(npc, activeChar), generalDropItem.getMax(npc, activeChar), generalDropItem.isPreciseCalculated());
final MinMax minMax = getPreciseMinMax(normalized.getChance(), generalDropItem.getMin(npc, activeChar), generalDropItem.getMax(npc, activeChar), generalDropItem.isPreciseCalculated());
final long min = minMax.min;
final long max = minMax.max;
if (min == max)
@@ -406,7 +406,7 @@ public class NpcViewMod implements IBypassHandler
sb.append("</font></td></tr><tr><td width=32></td><td width=300><table width=295 cellpadding=0 cellspacing=0>");
sb.append("<tr><td width=48 align=right valign=top><font color=\"LEVEL\">Amount:</font></td>");
sb.append("<td width=247 align=center>");
MinMax minMax = getPreciseMinMax(dropItem.getChance(npc, activeChar), dropItem.getMin(npc, activeChar), dropItem.getMax(npc, activeChar), dropItem.isPreciseCalculated());
final MinMax minMax = getPreciseMinMax(dropItem.getChance(npc, activeChar), dropItem.getMin(npc, activeChar), dropItem.getMax(npc, activeChar), dropItem.isPreciseCalculated());
final long min = minMax.min;
final long max = minMax.max;
@@ -447,7 +447,7 @@ public class NpcViewMod implements IBypassHandler
return new MinMax(min, max);
}
int mult = (int) (chance) / 100;
final int mult = (int) (chance) / 100;
return new MinMax(mult * min, (chance % 100) > 0 ? (mult + 1) * max : mult * max);
}
}

View File

@@ -108,7 +108,7 @@ public class Observation implements IBypassHandler
return false;
}
String _command = command.split(" ")[0].toLowerCase();
final String _command = command.split(" ")[0].toLowerCase();
final int param;
try
{
@@ -126,7 +126,7 @@ public class Observation implements IBypassHandler
}
final int[] locCost = LOCATIONS[param];
Location loc = new Location(locCost[0], locCost[1], locCost[2]);
final Location loc = new Location(locCost[0], locCost[1], locCost[2]);
final long cost = locCost[3];
switch (_command)

View File

@@ -89,8 +89,8 @@ public class OlympiadManagerLink implements IBypassHandler
{
if (command.toLowerCase().startsWith("olympiaddesc"))
{
int val = Integer.parseInt(command.substring(13, 14));
String suffix = command.substring(14);
final int val = Integer.parseInt(command.substring(13, 14));
final String suffix = command.substring(14);
((L2OlympiadManagerInstance) target).showChatWindow(activeChar, val, suffix);
}
else if (command.toLowerCase().startsWith("olympiadnoble"))
@@ -118,7 +118,7 @@ public class OlympiadManagerLink implements IBypassHandler
}
int passes;
int val = Integer.parseInt(command.substring(14));
final int val = Integer.parseInt(command.substring(14));
switch (val)
{
case 0: // H5 match selection
@@ -173,7 +173,7 @@ public class OlympiadManagerLink implements IBypassHandler
activeChar.sendPacket(html);
break;
case 3: // There are %points% Grand Olympiad points granted for this event. | TODO: cleanup (not used anymore)
int points = Olympiad.getInstance().getNoblePoints(activeChar.getObjectId());
final int points = Olympiad.getInstance().getNoblePoints(activeChar.getObjectId());
html.setFile(activeChar.getHtmlPrefix(), Olympiad.OLYMPIAD_HTML_PATH + "noble_points1.htm");
html.replace("%points%", String.valueOf(points));
html.replace("%objectId%", String.valueOf(target.getObjectId()));
@@ -207,7 +207,7 @@ public class OlympiadManagerLink implements IBypassHandler
MultisellData.getInstance().separateAndSend(103, activeChar, (L2Npc) target, false);
break;
case 9: // Your Grand Olympiad Score from the previous period is %points% point(s) | TODO: cleanup (not used anymore)
int point = Olympiad.getInstance().getLastNobleOlympiadPoints(activeChar.getObjectId());
final int point = Olympiad.getInstance().getLastNobleOlympiadPoints(activeChar.getObjectId());
html.setFile(activeChar.getHtmlPrefix(), Olympiad.OLYMPIAD_HTML_PATH + "noble_points2.htm");
html.replace("%points%", String.valueOf(point));
html.replace("%objectId%", String.valueOf(target.getObjectId()));
@@ -217,9 +217,9 @@ public class OlympiadManagerLink implements IBypassHandler
passes = Olympiad.getInstance().getNoblessePasses(activeChar, true);
if (passes > 0)
{
L2ItemInstance item = activeChar.getInventory().addItem("Olympiad", GATE_PASS, passes, activeChar, target);
final L2ItemInstance item = activeChar.getInventory().addItem("Olympiad", GATE_PASS, passes, activeChar, target);
InventoryUpdate iu = new InventoryUpdate();
final InventoryUpdate iu = new InventoryUpdate();
iu.addModifiedItem(item);
activeChar.sendPacket(iu);
@@ -246,7 +246,7 @@ public class OlympiadManagerLink implements IBypassHandler
}
final NpcHtmlMessage html = new NpcHtmlMessage(target.getObjectId());
String[] params = command.split(" ");
final String[] params = command.split(" ");
if (!Util.isDigit(params[1]))
{
@@ -309,7 +309,7 @@ public class OlympiadManagerLink implements IBypassHandler
}
else if (command.toLowerCase().startsWith("olympiad"))
{
int val = Integer.parseInt(command.substring(9, 10));
final int val = Integer.parseInt(command.substring(9, 10));
final NpcHtmlMessage reply = new NpcHtmlMessage(target.getObjectId());
@@ -317,10 +317,10 @@ public class OlympiadManagerLink implements IBypassHandler
{
case 2: // show rank for a specific class
// for example >> Olympiad 1_88
int classId = Integer.parseInt(command.substring(11));
final int classId = Integer.parseInt(command.substring(11));
if (((classId >= 88) && (classId <= 118)) || ((classId >= 131) && (classId <= 134)) || (classId == 136))
{
List<String> names = Olympiad.getInstance().getClassLeaderBoard(classId);
final List<String> names = Olympiad.getInstance().getClassLeaderBoard(classId);
reply.setFile(activeChar.getHtmlPrefix(), Olympiad.OLYMPIAD_HTML_PATH + "olympiad_ranking.htm");
int index = 1;

View File

@@ -61,7 +61,7 @@ public class QuestLink implements IBypassHandler
}
else
{
int questNameEnd = quest.indexOf(" ");
final int questNameEnd = quest.indexOf(" ");
if (questNameEnd == -1)
{
showQuestWindow(activeChar, (L2Npc) target, quest);

View File

@@ -56,7 +56,7 @@ public class RentPet implements IBypassHandler
try
{
StringTokenizer st = new StringTokenizer(command, " ");
final StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
if (st.countTokens() < 1)
@@ -93,14 +93,14 @@ public class RentPet implements IBypassHandler
int petId;
double price = 1;
int cost[] =
final int cost[] =
{
1800,
7200,
720000,
6480000
};
int ridetime[] =
final int ridetime[] =
{
30,
60,
@@ -125,7 +125,7 @@ public class RentPet implements IBypassHandler
}
price *= cost[val - 1];
int time = ridetime[val - 1];
final int time = ridetime[val - 1];
if (!player.reduceAdena("Rent", (long) price, player.getLastFolkNPC(), true))
{
@@ -133,7 +133,7 @@ public class RentPet implements IBypassHandler
}
player.mount(petId, 0, false);
SetupGauge sg = new SetupGauge(3, time * 1000);
final SetupGauge sg = new SetupGauge(3, time * 1000);
player.sendPacket(sg);
player.startRentPet(time);
}

View File

@@ -51,7 +51,7 @@ public class SkillList implements IBypassHandler
{
try
{
String id = command.substring(9).trim();
final String id = command.substring(9).trim();
if (id.length() != 0)
{
L2NpcInstance.showSkillList(activeChar, (L2Npc) target, ClassId.getClassId(Integer.parseInt(id)));
@@ -74,7 +74,7 @@ public class SkillList implements IBypassHandler
if (!own_class)
{
String charType = activeChar.getClassId().isMage() ? "fighter" : "mage";
final String charType = activeChar.getClassId().isMage() ? "fighter" : "mage";
text += "Skills of your class are the easiest to learn.<br>" + "Skills of another class of your race are a little harder.<br>" + "Skills for classes of another race are extremely difficult.<br>" + "But the hardest of all to learn are the " + charType + "skills!<br>";
}

View File

@@ -47,7 +47,7 @@ public class TerritoryStatus implements IBypassHandler
if (npc.getCastle().getOwnerId() > 0)
{
html.setFile(activeChar.getHtmlPrefix(), "html/territorystatus.htm");
L2Clan clan = ClanTable.getInstance().getClan(npc.getCastle().getOwnerId());
final L2Clan clan = ClanTable.getInstance().getClan(npc.getCastle().getOwnerId());
html.replace("%clanname%", clan.getName());
html.replace("%clanleadername%", clan.getLeaderName());
}

View File

@@ -41,7 +41,7 @@ public class VoiceCommand implements IBypassHandler
if ((command.length() > 7) && (command.charAt(6) == '.'))
{
final String vc, vparams;
int endOfCommand = command.indexOf(" ", 7);
final int endOfCommand = command.indexOf(" ", 7);
if (endOfCommand > 0)
{
vc = command.substring(7, endOfCommand).trim();
@@ -55,7 +55,7 @@ public class VoiceCommand implements IBypassHandler
if (vc.length() > 0)
{
IVoicedCommandHandler vch = VoicedCommandHandler.getInstance().getHandler(vc);
final IVoicedCommandHandler vch = VoicedCommandHandler.getInstance().getHandler(vc);
if (vch != null)
{
return vch.useVoicedCommand(vc, activeChar, vparams);

View File

@@ -52,7 +52,7 @@ public class Wear implements IBypassHandler
try
{
StringTokenizer st = new StringTokenizer(command, " ");
final StringTokenizer st = new StringTokenizer(command, " ");
st.nextToken();
if (st.countTokens() < 1)