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

@@ -192,11 +192,11 @@ public class CharSummonTable
Skill skill;
while (rs.next())
{
int summonObjId = rs.getInt("summonId");
int skillId = rs.getInt("summonSkillId");
int curHp = rs.getInt("curHp");
int curMp = rs.getInt("curMp");
int time = rs.getInt("time");
final int summonObjId = rs.getInt("summonId");
final int skillId = rs.getInt("summonSkillId");
final int curHp = rs.getInt("curHp");
final int curMp = rs.getInt("curMp");
final int time = rs.getInt("time");
skill = SkillData.getInstance().getSkill(skillId, activeChar.getSkillLevel(skillId));
if ((skill == null) || !activeChar.hasServitor(summonObjId))

View File

@@ -88,7 +88,7 @@ public class ClanTable
{
while (rs.next())
{
int clanId = rs.getInt("clan_id");
final int clanId = rs.getInt("clan_id");
_clans.put(clanId, new L2Clan(clanId));
clan = getClan(clanId);
if (clan.getDissolvingExpiryTime() != 0)
@@ -186,14 +186,14 @@ public class ClanTable
if (null != getClanByName(clanName))
{
// clan name is already taken
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_ALREADY_EXISTS);
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_ALREADY_EXISTS);
sm.addString(clanName);
player.sendPacket(sm);
return null;
}
L2Clan clan = new L2Clan(IdFactory.getInstance().getNextId(), clanName);
L2ClanMember leader = new L2ClanMember(clan, player);
final L2Clan clan = new L2Clan(IdFactory.getInstance().getNextId(), clanName);
final L2ClanMember leader = new L2ClanMember(clan, player);
clan.setLeader(leader);
leader.setPlayerInstance(player);
clan.store();
@@ -217,14 +217,14 @@ public class ClanTable
public synchronized void destroyClan(int clanId)
{
L2Clan clan = getClan(clanId);
final L2Clan clan = getClan(clanId);
if (clan == null)
{
return;
}
clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.CLAN_HAS_DISPERSED));
int castleId = clan.getCastleId();
final int castleId = clan.getCastleId();
if (castleId == 0)
{
for (Siege siege : SiegeManager.getInstance().getSieges())
@@ -233,7 +233,7 @@ public class ClanTable
}
}
int fortId = clan.getFortId();
final int fortId = clan.getFortId();
if (fortId == 0)
{
for (FortSiege siege : FortSiegeManager.getInstance().getSieges())
@@ -242,7 +242,7 @@ public class ClanTable
}
}
int hallId = clan.getHideoutId();
final int hallId = clan.getHideoutId();
if (hallId == 0)
{
for (SiegableHall hall : CHSiegeManager.getInstance().getConquerableHalls().values())
@@ -251,13 +251,13 @@ public class ClanTable
}
}
Auction auction = ClanHallAuctionManager.getInstance().getAuction(clan.getAuctionBiddedAt());
final Auction auction = ClanHallAuctionManager.getInstance().getAuction(clan.getAuctionBiddedAt());
if (auction != null)
{
auction.cancelBid(clan.getId());
}
L2ClanMember leaderMember = clan.getLeader();
final L2ClanMember leaderMember = clan.getLeader();
if (leaderMember == null)
{
clan.getWarehouse().destroyAllItems("ClanRemove", null, null);
@@ -325,10 +325,10 @@ public class ClanTable
if (fortId != 0)
{
Fort fort = FortManager.getInstance().getFortById(fortId);
final Fort fort = FortManager.getInstance().getFortById(fortId);
if (fort != null)
{
L2Clan owner = fort.getOwnerClan();
final L2Clan owner = fort.getOwnerClan();
if (clan == owner)
{
fort.removeOwner(true);
@@ -338,7 +338,7 @@ public class ClanTable
if (hallId != 0)
{
SiegableHall hall = CHSiegeManager.getInstance().getSiegableHall(hallId);
final SiegableHall hall = CHSiegeManager.getInstance().getSiegableHall(hallId);
if ((hall != null) && (hall.getOwnerId() == clanId))
{
hall.free();
@@ -424,8 +424,8 @@ public class ClanTable
public void deleteclanswars(int clanId1, int clanId2)
{
L2Clan clan1 = getClan(clanId1);
L2Clan clan2 = getClan(clanId2);
final L2Clan clan1 = getClan(clanId1);
final L2Clan clan2 = getClan(clanId2);
EventDispatcher.getInstance().notifyEventAsync(new OnClanWarFinish(clan1, clan2));
@@ -508,7 +508,7 @@ public class ClanTable
{
for (L2Clan clan : _clans.values())
{
int allyId = clan.getAllyId();
final int allyId = clan.getAllyId();
if ((allyId != 0) && (clan.getId() != allyId))
{
if (!_clans.containsKey(allyId))

View File

@@ -55,7 +55,7 @@ public final class CrestTable
public synchronized void load()
{
_crests.clear();
Set<Integer> crestsInUse = new HashSet<>();
final Set<Integer> crestsInUse = new HashSet<>();
for (L2Clan clan : ClanTable.getInstance().getClans())
{
if (clan.getCrestId() != 0)
@@ -80,7 +80,7 @@ public final class CrestTable
{
while (rs.next())
{
int id = rs.getInt("crest_id");
final int id = rs.getInt("crest_id");
if (_nextId.get() <= id)
{
@@ -95,8 +95,8 @@ public final class CrestTable
continue;
}
byte[] data = rs.getBytes("data");
CrestType crestType = CrestType.getById(rs.getInt("type"));
final byte[] data = rs.getBytes("data");
final CrestType crestType = CrestType.getById(rs.getInt("type"));
if (crestType != null)
{
_crests.put(id, new L2Crest(id, data, crestType));

View File

@@ -99,12 +99,12 @@ public class NpcBufferTable
while (rset.next())
{
int npcId = rset.getInt("npc_id");
int skillId = rset.getInt("skill_id");
int skillLevel = rset.getInt("skill_level");
int skillFeeId = rset.getInt("skill_fee_id");
int skillFeeAmount = rset.getInt("skill_fee_amount");
int buffGroup = rset.getInt("buff_group");
final int npcId = rset.getInt("npc_id");
final int skillId = rset.getInt("skill_id");
final int skillLevel = rset.getInt("skill_level");
final int skillFeeId = rset.getInt("skill_fee_id");
final int skillFeeAmount = rset.getInt("skill_fee_amount");
final int buffGroup = rset.getInt("buff_group");
if (npcId != lastNpcId)
{
@@ -145,12 +145,12 @@ public class NpcBufferTable
NpcBufferSkills skills = null;
while (rset.next())
{
int npcId = rset.getInt("npc_id");
int skillId = rset.getInt("skill_id");
int skillLevel = rset.getInt("skill_level");
int skillFeeId = rset.getInt("skill_fee_id");
int skillFeeAmount = rset.getInt("skill_fee_amount");
int buffGroup = rset.getInt("buff_group");
final int npcId = rset.getInt("npc_id");
final int skillId = rset.getInt("skill_id");
final int skillLevel = rset.getInt("skill_level");
final int skillFeeId = rset.getInt("skill_fee_id");
final int skillFeeAmount = rset.getInt("skill_fee_amount");
final int buffGroup = rset.getInt("buff_group");
if (npcId != lastNpcId)
{

View File

@@ -154,10 +154,10 @@ public class OfflineTradersTable
{
while (rs.next())
{
long time = rs.getLong("time");
final long time = rs.getLong("time");
if (Config.OFFLINE_MAX_DAYS > 0)
{
Calendar cal = Calendar.getInstance();
final Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(time);
cal.add(Calendar.DAY_OF_YEAR, Config.OFFLINE_MAX_DAYS);
if (cal.getTimeInMillis() <= System.currentTimeMillis())
@@ -166,7 +166,7 @@ public class OfflineTradersTable
}
}
PrivateStoreType type = PrivateStoreType.findById(rs.getInt("type"));
final PrivateStoreType type = PrivateStoreType.findById(rs.getInt("type"));
if (type == null)
{
LOGGER.warning(getClass().getSimpleName() + ": PrivateStoreType with id " + rs.getInt("type") + " could not be found.");
@@ -182,7 +182,7 @@ public class OfflineTradersTable
try
{
L2GameClient client = new L2GameClient(null);
final L2GameClient client = new L2GameClient(null);
client.setDetached(true);
player = L2PcInstance.load(rs.getInt("charId"));
client.setActiveChar(player);

View File

@@ -48,7 +48,7 @@ public class PetNameTable
PreparedStatement ps = con.prepareStatement("SELECT name FROM pets p, items i WHERE p.item_obj_id = i.object_id AND name=? AND i.item_id IN (?)"))
{
ps.setString(1, name);
StringBuilder cond = new StringBuilder();
final StringBuilder cond = new StringBuilder();
if (!cond.toString().isEmpty())
{
cond.append(", ");
@@ -87,7 +87,7 @@ public class PetNameTable
LOGGER.warning(getClass().getSimpleName() + ": Pet name pattern of config is wrong!");
pattern = Pattern.compile(".*");
}
Matcher regexp = pattern.matcher(name);
final Matcher regexp = pattern.matcher(name);
if (!regexp.matches())
{
result = false;
@@ -98,7 +98,7 @@ public class PetNameTable
private boolean isAlphaNumeric(String text)
{
boolean result = true;
char[] chars = text.toCharArray();
final char[] chars = text.toCharArray();
for (int i = 0; i < chars.length; i++)
{
if (!Character.isLetterOrDigit(chars[i]))

View File

@@ -61,8 +61,8 @@ public class SummonSkillsTable
_skillTrees.put(npcId, skillTree);
}
int id = rs.getInt("skillId");
int lvl = rs.getInt("skillLvl");
final int id = rs.getInt("skillId");
final int lvl = rs.getInt("skillLvl");
skillTree.put(SkillData.getSkillHashCode(id, lvl + 1), new L2PetSkillLearn(id, lvl, rs.getInt("minLvl")));
count++;
}
@@ -82,7 +82,7 @@ public class SummonSkillsTable
LOGGER.warning(getClass().getSimpleName() + ": Pet id " + cha.getId() + " does not have any skills assigned.");
return lvl;
}
Collection<L2PetSkillLearn> skills = _skillTrees.get(cha.getId()).values();
final Collection<L2PetSkillLearn> skills = _skillTrees.get(cha.getId()).values();
for (L2PetSkillLearn temp : skills)
{
if (temp.getId() != skillId)
@@ -105,7 +105,7 @@ public class SummonSkillsTable
}
// formula usable for skill that have 10 or more skill levels
int maxLvl = SkillData.getInstance().getMaxLevel(temp.getId());
final int maxLvl = SkillData.getInstance().getMaxLevel(temp.getId());
if (lvl > maxLvl)
{
lvl = maxLvl;
@@ -125,13 +125,13 @@ public class SummonSkillsTable
public List<Integer> getAvailableSkills(L2Summon cha)
{
List<Integer> skillIds = new ArrayList<>();
final List<Integer> skillIds = new ArrayList<>();
if (!_skillTrees.containsKey(cha.getId()))
{
LOGGER.warning(getClass().getSimpleName() + ": Pet id " + cha.getId() + " does not have any skills assigned.");
return skillIds;
}
Collection<L2PetSkillLearn> skills = _skillTrees.get(cha.getId()).values();
final Collection<L2PetSkillLearn> skills = _skillTrees.get(cha.getId()).values();
for (L2PetSkillLearn temp : skills)
{
if (skillIds.contains(temp.getId()))

View File

@@ -80,7 +80,7 @@ public class TerritoryTable
{
while (rset.next())
{
int terrId = rset.getInt("loc_id");
final int terrId = rset.getInt("loc_id");
L2Territory terr = _territory.get(terrId);
if (terr == null)
{