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

@@ -219,7 +219,7 @@ public class AugmentationData
private final void load()
{
// Load stats
DocumentBuilderFactory factory2 = DocumentBuilderFactory.newInstance();
final DocumentBuilderFactory factory2 = DocumentBuilderFactory.newInstance();
factory2.setValidating(false);
factory2.setIgnoringComments(true);
@@ -232,18 +232,18 @@ public class AugmentationData
try
{
int badAugmantData = 0;
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setIgnoringComments(true);
File file = new File(Config.DATAPACK_ROOT + "/stats/augmentation/augmentation_skillmap.xml");
final File file = new File(Config.DATAPACK_ROOT + "/stats/augmentation/augmentation_skillmap.xml");
if (!file.exists())
{
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": ERROR The augmentation skillmap file is missing.");
return;
}
Document doc = factory.newDocumentBuilder().parse(file);
final Document doc = factory.newDocumentBuilder().parse(file);
for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
{
@@ -254,7 +254,8 @@ public class AugmentationData
if ("augmentation".equalsIgnoreCase(d.getNodeName()))
{
NamedNodeMap attrs = d.getAttributes();
int skillId = 0, augmentationId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
int skillId = 0;
final int augmentationId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
int skillLvL = 0;
String type = "blue";
@@ -286,7 +287,7 @@ public class AugmentationData
badAugmantData++;
continue;
}
int k = (augmentationId - BLUE_START) / SKILLS_BLOCKSIZE;
final int k = (augmentationId - BLUE_START) / SKILLS_BLOCKSIZE;
if (type.equalsIgnoreCase("blue"))
{
@@ -319,11 +320,11 @@ public class AugmentationData
}
else
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setIgnoringComments(true);
File aFile = new File(Config.DATAPACK_ROOT + "/stats/augmentation/retailchances.xml");
final File aFile = new File(Config.DATAPACK_ROOT + "/stats/augmentation/retailchances.xml");
if (aFile.exists())
{
Document aDoc = null;
@@ -413,11 +414,11 @@ public class AugmentationData
}
if (Config.RETAIL_LIKE_AUGMENTATION_ACCESSORY)
{
DocumentBuilderFactory factory3 = DocumentBuilderFactory.newInstance();
final DocumentBuilderFactory factory3 = DocumentBuilderFactory.newInstance();
factory3.setValidating(false);
factory3.setIgnoringComments(true);
File aFile3 = new File(Config.DATAPACK_ROOT + "/stats/augmentation/retailchances_accessory.xml");
final File aFile3 = new File(Config.DATAPACK_ROOT + "/stats/augmentation/retailchances_accessory.xml");
if (aFile3.exists())
{
Document aDoc = null;
@@ -536,8 +537,8 @@ public class AugmentationData
{
if (item.getItem().isMagicWeapon())
{
List<AugmentationChance> _selectedChances12 = new ArrayList<>();
List<AugmentationChance> _selectedChances34 = new ArrayList<>();
final List<AugmentationChance> _selectedChances12 = new ArrayList<>();
final List<AugmentationChance> _selectedChances34 = new ArrayList<>();
for (AugmentationChance ac : _augmentationChances)
{
if (ac.getWeaponType().equals("mage") && (ac.getStoneId() == lifeStoneId))
@@ -598,7 +599,7 @@ public class AugmentationData
{
c = 3;
}
List<AugmentationChance> _selectedChances34final = new ArrayList<>();
final List<AugmentationChance> _selectedChances34final = new ArrayList<>();
for (AugmentationChance ac : _selectedChances34)
{
if (ac.getCategoryChance() == c)
@@ -621,8 +622,8 @@ public class AugmentationData
}
else
{
List<AugmentationChance> _selectedChances12 = new ArrayList<>();
List<AugmentationChance> _selectedChances34 = new ArrayList<>();
final List<AugmentationChance> _selectedChances12 = new ArrayList<>();
final List<AugmentationChance> _selectedChances34 = new ArrayList<>();
for (AugmentationChance ac : _augmentationChances)
{
if (ac.getWeaponType().equals("warrior") && (ac.getStoneId() == lifeStoneId))
@@ -683,7 +684,7 @@ public class AugmentationData
{
c = 3;
}
List<AugmentationChance> _selectedChances34final = new ArrayList<>();
final List<AugmentationChance> _selectedChances34final = new ArrayList<>();
for (AugmentationChance ac : _selectedChances34)
{
if (ac.getCategoryChance() == c)
@@ -838,8 +839,8 @@ public class AugmentationData
int offset;
if (stat34 == 0)
{
int temp = Rnd.get(2, 3);
int colorOffset = (resultColor * (10 * STAT_SUBBLOCKSIZE)) + (temp * STAT_BLOCKSIZE) + 1;
final int temp = Rnd.get(2, 3);
final int colorOffset = (resultColor * (10 * STAT_SUBBLOCKSIZE)) + (temp * STAT_BLOCKSIZE) + 1;
offset = (lifeStoneLevel * STAT_SUBBLOCKSIZE) + colorOffset;
stat34 = Rnd.get(offset, (offset + STAT_SUBBLOCKSIZE) - 1);
@@ -878,8 +879,8 @@ public class AugmentationData
int stat34 = 0;
if (Config.RETAIL_LIKE_AUGMENTATION_ACCESSORY)
{
List<augmentationChanceAcc> _selectedChances12 = new ArrayList<>();
List<augmentationChanceAcc> _selectedChances34 = new ArrayList<>();
final List<augmentationChanceAcc> _selectedChances12 = new ArrayList<>();
final List<augmentationChanceAcc> _selectedChances34 = new ArrayList<>();
for (augmentationChanceAcc ac : _augmentationChancesAcc)
{
if (ac.getWeaponType().equals("warrior") && (ac.getStoneId() == lifeStoneId))
@@ -921,7 +922,7 @@ public class AugmentationData
{
c = 1;
}
List<augmentationChanceAcc> _selectedChances34final = new ArrayList<>();
final List<augmentationChanceAcc> _selectedChances34final = new ArrayList<>();
for (augmentationChanceAcc ac : _selectedChances34)
{
if (ac.getCategoryChance() == c)
@@ -964,7 +965,7 @@ public class AugmentationData
return null;
}
int resultColor = Rnd.get(0, 3);
final int resultColor = Rnd.get(0, 3);
// first augmentation (stats only)
stat12 = Rnd.get(ACC_STAT_SUBBLOCKSIZE);

View File

@@ -86,13 +86,13 @@ public final class BotReportTable
try
{
File punishments = new File("./config/botreport_punishments.xml");
final File punishments = new File("./config/botreport_punishments.xml");
if (!punishments.exists())
{
throw new FileNotFoundException(punishments.getName());
}
SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
final SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
parser.parse(punishments, new PunishmentsLoader());
}
catch (Exception e)
@@ -118,8 +118,8 @@ public final class BotReportTable
long lastResetTime = 0;
try
{
String[] hour = Config.BOTREPORT_RESETPOINT_HOUR;
Calendar c = Calendar.getInstance();
final String[] hour = Config.BOTREPORT_RESETPOINT_HOUR;
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
@@ -137,16 +137,16 @@ public final class BotReportTable
while (rset.next())
{
int botId = rset.getInt(COLUMN_BOT_ID);
int reporter = rset.getInt(COLUMN_REPORTER_ID);
long date = rset.getLong(COLUMN_REPORT_TIME);
final int botId = rset.getInt(COLUMN_BOT_ID);
final int reporter = rset.getInt(COLUMN_REPORTER_ID);
final long date = rset.getLong(COLUMN_REPORT_TIME);
if (_reports.containsKey(botId))
{
_reports.get(botId).addReporter(reporter, date);
}
else
{
ReportedCharData rcd = new ReportedCharData();
final ReportedCharData rcd = new ReportedCharData();
rcd.addReporter(reporter, date);
_reports.put(rset.getInt(COLUMN_BOT_ID), rcd);
}
@@ -189,7 +189,7 @@ public final class BotReportTable
for (Map.Entry<Integer, ReportedCharData> entrySet : _reports.entrySet())
{
Map<Integer, Long> reportTable = entrySet.getValue()._reporters;
final Map<Integer, Long> reportTable = entrySet.getValue()._reporters;
for (int reporterId : reportTable.keySet())
{
ps.setInt(1, entrySet.getKey());
@@ -212,14 +212,14 @@ public final class BotReportTable
*/
public boolean reportBot(L2PcInstance reporter)
{
L2Object target = reporter.getTarget();
final L2Object target = reporter.getTarget();
if (target == null)
{
return false;
}
L2PcInstance bot = target.getActingPlayer();
final L2PcInstance bot = target.getActingPlayer();
if ((bot == null) || (target.getObjectId() == reporter.getObjectId()))
{
@@ -292,10 +292,10 @@ public final class BotReportTable
return false;
}
long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
final long reuse = (System.currentTimeMillis() - rcdRep.getLastReporTime());
if (reuse < Config.BOTREPORT_REPORT_DELAY)
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_CAN_MAKE_ANOTHER_REPORT_IN_S1_MINUTE_S_YOU_HAVE_S2_POINT_S_REMAINING_ON_THIS_ACCOUNT);
sm.addInt((int) (reuse / 60000));
sm.addInt(rcdRep.getPointsLeft());
reporter.sendPacket(sm);
@@ -368,7 +368,7 @@ public final class BotReportTable
ph._punish.applyEffects(bot, bot);
if (ph._systemMessageId > -1)
{
SystemMessageId id = SystemMessageId.getSystemMessageId(ph._systemMessageId);
final SystemMessageId id = SystemMessageId.getSystemMessageId(ph._systemMessageId);
if (id != null)
{
bot.sendPacket(id);
@@ -386,7 +386,7 @@ public final class BotReportTable
*/
void addPunishment(int neededReports, int skillId, int skillLevel, int sysMsg)
{
Skill sk = SkillData.getInstance().getSkill(skillId, skillLevel);
final Skill sk = SkillData.getInstance().getSkill(skillId, skillLevel);
if (sk != null)
{
_punishments.put(neededReports, new PunishHolder(sk, sysMsg));
@@ -414,8 +414,8 @@ public final class BotReportTable
{
try
{
String[] hour = Config.BOTREPORT_RESETPOINT_HOUR;
Calendar c = Calendar.getInstance();
final String[] hour = Config.BOTREPORT_RESETPOINT_HOUR;
final Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, Integer.parseInt(hour[0]));
c.set(Calendar.MINUTE, Integer.parseInt(hour[1]));
@@ -445,9 +445,9 @@ public final class BotReportTable
*/
private static int hashIp(L2PcInstance player)
{
String con = player.getClient().getConnection().getInetAddress().getHostAddress();
String[] rawByte = con.split("\\.");
int[] rawIp = new int[4];
final String con = player.getClient().getConnection().getInetAddress().getHostAddress();
final String[] rawByte = con.split("\\.");
final int[] rawIp = new int[4];
for (int i = 0; i < 4; i++)
{
rawIp[i] = Integer.parseInt(rawByte[i]);
@@ -572,8 +572,8 @@ public final class BotReportTable
{
reportCount = Integer.parseInt(attr.getValue("neededReportCount"));
skillId = Integer.parseInt(attr.getValue("skillId"));
String level = attr.getValue("skillLevel");
String systemMessageId = attr.getValue("sysMessageId");
final String level = attr.getValue("skillLevel");
final String systemMessageId = attr.getValue("sysMessageId");
if (level != null)
{
skillLevel = Integer.parseInt(level);

View File

@@ -211,14 +211,14 @@ public class ItemTable
public L2ItemInstance createItem(String process, int itemId, long count, L2PcInstance actor, Object reference)
{
// Create and Init the L2ItemInstance corresponding to the Item Identifier
L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
final L2ItemInstance item = new L2ItemInstance(IdFactory.getInstance().getNextId(), itemId);
if (process.equalsIgnoreCase("loot"))
{
ScheduledFuture<?> itemLootShedule;
if ((reference instanceof L2Attackable) && ((L2Attackable) reference).isRaid()) // loot privilege for raids
{
L2Attackable raid = (L2Attackable) reference;
final L2Attackable raid = (L2Attackable) reference;
// if in CommandChannel and was killing a World/RaidBoss
if ((raid.getFirstCommandChannelAttacked() != null) && !Config.AUTO_LOOT_RAIDS)
{
@@ -253,7 +253,7 @@ public class ItemTable
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
LogRecord record = new LogRecord(Level.INFO, "CREATE:" + process);
final LogRecord record = new LogRecord(Level.INFO, "CREATE:" + process);
record.setLoggerName("item");
record.setParameters(new Object[]
{
@@ -278,7 +278,7 @@ public class ItemTable
{
referenceName = (String) reference;
}
String targetName = (actor.getTarget() != null ? actor.getTarget().getName() : "no-target");
final String targetName = (actor.getTarget() != null ? actor.getTarget().getName() : "no-target");
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]", process + "(id: " + itemId + " count: " + count + " name: " + item.getItemName() + " objId: " + item.getObjectId() + ")", targetName, "L2Object referencing this action is: " + referenceName);
@@ -313,7 +313,7 @@ public class ItemTable
{
synchronized (item)
{
long old = item.getCount();
final long old = item.getCount();
item.setCount(0);
item.setOwnerId(0);
item.setItemLocation(ItemLocation.VOID);
@@ -326,7 +326,7 @@ public class ItemTable
{
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (item.isEquipable() || (item.getId() == ADENA_ID))))
{
LogRecord record = new LogRecord(Level.INFO, "DELETE:" + process);
final LogRecord record = new LogRecord(Level.INFO, "DELETE:" + process);
record.setLoggerName("item");
record.setParameters(new Object[]
{
@@ -352,7 +352,7 @@ public class ItemTable
{
referenceName = (String) reference;
}
String targetName = (actor.getTarget() != null ? actor.getTarget().getName() : "no-target");
final String targetName = (actor.getTarget() != null ? actor.getTarget().getName() : "no-target");
if (Config.GMAUDIT)
{
GMAudit.auditGMAction(actor.getName() + " [" + actor.getObjectId() + "]", process + "(id: " + item.getId() + " count: " + item.getCount() + " itemObjId: " + item.getObjectId() + ")", targetName, "L2Object referencing this action is: " + referenceName);

View File

@@ -75,17 +75,17 @@ public class MerchantPriceConfigTable implements InstanceListManager
public void loadXML() throws SAXException, IOException, ParserConfigurationException
{
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setValidating(false);
factory.setIgnoringComments(true);
File file = new File(Config.DATAPACK_ROOT + "/" + MPCS_FILE);
final File file = new File(Config.DATAPACK_ROOT + "/" + MPCS_FILE);
if (file.exists())
{
int defaultPriceConfigId;
Document doc = factory.newDocumentBuilder().parse(file);
final Document doc = factory.newDocumentBuilder().parse(file);
Node n = doc.getDocumentElement();
Node dpcNode = n.getAttributes().getNamedItem("defaultPriceConfig");
final Node dpcNode = n.getAttributes().getNamedItem("defaultPriceConfig");
if (dpcNode == null)
{
throw new IllegalStateException("merchantPriceConfig must define an 'defaultPriceConfig'");
@@ -102,7 +102,7 @@ public class MerchantPriceConfigTable implements InstanceListManager
}
}
MerchantPriceConfig defaultMpc = this.getMerchantPriceConfig(defaultPriceConfigId);
final MerchantPriceConfig defaultMpc = this.getMerchantPriceConfig(defaultPriceConfigId);
if (defaultMpc == null)
{
throw new IllegalStateException("'defaultPriceConfig' points to an non-loaded priceConfig");
@@ -176,7 +176,7 @@ public class MerchantPriceConfigTable implements InstanceListManager
@Override
public void updateReferences()
{
for (final MerchantPriceConfig mpc : _mpcs.values())
for (MerchantPriceConfig mpc : _mpcs.values())
{
mpc.updateReferences();
}

View File

@@ -92,7 +92,7 @@ public class NpcPersonalAIData
{
if (_AIData.containsKey(spawnName))
{
Map<String, Integer> map = _AIData.get(spawnName);
final Map<String, Integer> map = _AIData.get(spawnName);
try
{

View File

@@ -90,7 +90,7 @@ public final class SpawnTable implements IXmlReader
*/
private boolean checkTemplate(int npcId)
{
L2NpcTemplate npcTemplate = NpcData.getInstance().getTemplate(npcId);
final L2NpcTemplate npcTemplate = NpcData.getInstance().getTemplate(npcId);
if (npcTemplate == null)
{
LOGGER.warning(getClass().getSimpleName() + ": Data missing in NPC table for ID: " + npcId + ".");
@@ -198,7 +198,7 @@ public final class SpawnTable implements IXmlReader
continue;
}
StatsSet spawnInfo = new StatsSet();
final StatsSet spawnInfo = new StatsSet();
spawnInfo.set("npcTemplateid", templateId);
spawnInfo.set("x", x);
spawnInfo.set("y", y);
@@ -229,7 +229,7 @@ public final class SpawnTable implements IXmlReader
if (attrs.getNamedItem("periodOfDay") != null)
{
String period = attrs.getNamedItem("periodOfDay").getNodeValue();
final String period = attrs.getNamedItem("periodOfDay").getNodeValue();
if (period.equalsIgnoreCase("day") || period.equalsIgnoreCase("night"))
{
spawnInfo.set("periodOfDay", period.equalsIgnoreCase("day") ? 1 : 2);
@@ -259,8 +259,8 @@ public final class SpawnTable implements IXmlReader
{
while (rs.next())
{
StatsSet spawnInfo = new StatsSet();
int npcId = rs.getInt("npc_templateid");
final StatsSet spawnInfo = new StatsSet();
final int npcId = rs.getInt("npc_templateid");
// Check basic requirements first
if (!checkTemplate(npcId))
@@ -310,8 +310,8 @@ public final class SpawnTable implements IXmlReader
spawnDat.setHeading(spawnInfo.getInt("heading", -1));
spawnDat.setRespawnDelay(spawnInfo.getInt("respawnDelay", 0), spawnInfo.getInt("respawnRandom", 0));
spawnDat.setLocationId(spawnInfo.getInt("locId", 0));
String territoryName = spawnInfo.getString("territoryName", "");
String spawnName = spawnInfo.getString("spawnName", "");
final String territoryName = spawnInfo.getString("territoryName", "");
final String spawnName = spawnInfo.getString("spawnName", "");
spawnDat.setCustom(spawnInfo.getBoolean("isCustomSpawn", false));
if (!spawnName.isEmpty())
{
@@ -479,7 +479,7 @@ public final class SpawnTable implements IXmlReader
final Set<L2Spawn> set = _spawnTable.get(spawn.getId());
if (set != null)
{
boolean removed = set.remove(spawn);
final boolean removed = set.remove(spawn);
if (set.isEmpty())
{
_spawnTable.remove(spawn.getId());