Code review Part 3.

This commit is contained in:
MobiusDevelopment 2019-12-20 00:35:40 +00:00
parent 6954f58f5e
commit cd1f62cc68
2014 changed files with 9456 additions and 12142 deletions

View File

@ -110,7 +110,7 @@ public class Nottingale extends AbstractNpcAI
case "32627-09.html":
case "32627-10.html":
{
player.sendPacket(RADARS.get(Integer.valueOf(event.substring(6, 8))));
player.sendPacket(RADARS.get(Integer.parseInt(event.substring(6, 8))));
htmltext = event;
break;
}

View File

@ -163,7 +163,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
final String[] params = event.split(" ");
if (Util.isDigit(params[1]))
{
final int objectId = Integer.valueOf(params[1]);
final int objectId = Integer.parseInt(params[1]);
MentorManager.getInstance().getMentees(objectId).stream().filter(Objects::nonNull).filter(Mentee::isOnline).forEach(mentee ->
{
final PlayerInstance menteePlayer = mentee.getPlayerInstance();

View File

@ -241,7 +241,7 @@ public class Race extends Event
}
else
{
final int _number = Integer.valueOf(bypass.substring(5));
final int _number = Integer.parseInt(bypass.substring(5));
final Skill _sk = SkillData.getInstance().getSkill(_number, 1);
if (_sk != null)
{
@ -258,7 +258,7 @@ public class Race extends Event
}
else if (bypass.startsWith("tele"))
{
if ((Integer.valueOf(bypass.substring(4)) > 0) && (_randspawn != null))
if ((Integer.parseInt(bypass.substring(4)) > 0) && (_randspawn != null))
{
player.teleToLocation(_randspawn[0], _randspawn[1], _randspawn[2]);
}

View File

@ -256,17 +256,17 @@ public class AdminAdmin implements IAdminCommandHandler
{
case "RateXp":
{
Config.RATE_XP = Float.valueOf(pValue);
Config.RATE_XP = Float.parseFloat(pValue);
break;
}
case "RateSp":
{
Config.RATE_SP = Float.valueOf(pValue);
Config.RATE_SP = Float.parseFloat(pValue);
break;
}
case "RateDropSpoil":
{
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.parseFloat(pValue);
break;
}
}

View File

@ -454,7 +454,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
final String token = st.nextToken();
if (Util.isDigit(token))
{
page = Integer.valueOf(token);
page = Integer.parseInt(token);
}
}

View File

@ -56,7 +56,7 @@ public class AdminClanHall implements IAdminCommandHandler
final StringTokenizer st = new StringTokenizer(command, " ");
final String actualCommand = st.nextToken();
if (actualCommand.toLowerCase().equals("admin_clanhall"))
if (actualCommand.equalsIgnoreCase("admin_clanhall"))
{
processBypass(activeChar, new BypassParser(command));
}

View File

@ -67,7 +67,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminEditChar implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminEditChar.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminEditChar.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@ -33,7 +33,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminEnchant implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminEnchant.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminEnchant.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@ -33,7 +33,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminHeal implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminRes.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminRes.class.getName());
private static final String[] ADMIN_COMMANDS =
{
"admin_heal"

View File

@ -70,7 +70,7 @@ public class AdminPcCondOverride implements IAdminCommandHandler
final String token = st.nextToken();
if (Util.isDigit(token))
{
final PlayerCondOverride ex = PlayerCondOverride.getCondOverride(Integer.valueOf(token));
final PlayerCondOverride ex = PlayerCondOverride.getCondOverride(Integer.parseInt(token));
if (ex != null)
{
if (activeChar.canOverrideCond(ex))

View File

@ -32,7 +32,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
*/
public class AdminRepairChar implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminRepairChar.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminRepairChar.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@ -50,7 +50,7 @@ public class AdminShutdown implements IAdminCommandHandler
final String val = command.substring(22);
if (Util.isDigit(val))
{
serverShutdown(activeChar, Integer.valueOf(val), false);
serverShutdown(activeChar, Integer.parseInt(val), false);
}
else
{

View File

@ -60,7 +60,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminSkill implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminSkill.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminSkill.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@ -127,7 +127,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "01"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "01"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());
@ -147,7 +147,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "01"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "01"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());
@ -172,7 +172,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() + " (In Progress)" : "<fstring>" + quest.getNpcStringId() + "02</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "02"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "02"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());
@ -192,7 +192,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() + " (Done) " : "<fstring>" + quest.getNpcStringId() + "03</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "03"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "03"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());

View File

@ -80,7 +80,7 @@ public class PetFood implements IItemHandler
if (player.isMounted())
{
final List<Integer> foodIds = PetDataTable.getInstance().getPetData(player.getMountNpcId()).getFood();
if (foodIds.contains(Integer.valueOf(item.getId())))
if (foodIds.contains(item.getId()))
{
if (player.destroyItem("Consume", item.getObjectId(), 1, null, false))
{

View File

@ -135,7 +135,7 @@ public class Q00617_GatherTheFlames extends Quest
{
return getNoQuestMsg(player);
}
giveItems(player, Integer.valueOf(event), 1);
giveItems(player, Integer.parseInt(event), 1);
takeItems(player, TORCH, 1200);
htmltext = "32049-04.html";
break;
@ -147,7 +147,7 @@ public class Q00617_GatherTheFlames extends Quest
{
return getNoQuestMsg(player);
}
giveItems(player, Integer.valueOf(event), 1);
giveItems(player, Integer.parseInt(event), 1);
takeItems(player, TORCH, 1200);
htmltext = "32049-03.html";
break;

View File

@ -131,7 +131,7 @@ public class Q10287_StoryOfThoseLeft extends Quest
{
if (qs.isMemoState(2))
{
rewardItems(player, Integer.valueOf(event), 1);
rewardItems(player, Integer.parseInt(event), 1);
htmltext = "32020-09.html";
qs.exitQuest(false, true);
}

View File

@ -2112,7 +2112,7 @@ public class Config
try
{
MINIONS_RESPAWN_TIME.put(Integer.valueOf(propSplit[0]), Integer.valueOf(propSplit[1]));
MINIONS_RESPAWN_TIME.put(Integer.parseInt(propSplit[0]), Integer.parseInt(propSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -2228,7 +2228,7 @@ public class Config
{
try
{
RATE_DROP_AMOUNT_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
RATE_DROP_AMOUNT_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -2256,7 +2256,7 @@ public class Config
{
try
{
RATE_DROP_CHANCE_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
RATE_DROP_CHANCE_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -3118,7 +3118,7 @@ public class Config
final PropertiesParser FactionSystem = new PropertiesParser(CUSTOM_FACTION_SYSTEM_CONFIG_FILE);
String[] tempString;
FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false));
FACTION_SYSTEM_ENABLED = FactionSystem.getBoolean("EnableFactionSystem", false);
tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(",");
FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]));
tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(",");
@ -3140,16 +3140,16 @@ public class Config
// Load FakePlayers config file (if exists)
final PropertiesParser FakePlayers = new PropertiesParser(CUSTOM_FAKE_PLAYERS_CONFIG_FILE);
FAKE_PLAYERS_ENABLED = Boolean.valueOf(FakePlayers.getBoolean("EnableFakePlayers", false));
FAKE_PLAYER_CHAT = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerChat", false));
FAKE_PLAYER_USE_SHOTS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerUseShots", false));
FAKE_PLAYER_KILL_PVP = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerKillsRewardPvP", false));
FAKE_PLAYER_KILL_KARMA = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerUnflaggedKillsKarma", false));
FAKE_PLAYER_AGGRO_MONSTERS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerAggroMonsters", false));
FAKE_PLAYER_AGGRO_PLAYERS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerAggroPlayers", false));
FAKE_PLAYER_AGGRO_FPC = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerAggroFPC", false));
FAKE_PLAYER_CAN_DROP_ITEMS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerCanDropItems", false));
FAKE_PLAYER_CAN_PICKUP = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerCanPickup", false));
FAKE_PLAYERS_ENABLED = FakePlayers.getBoolean("EnableFakePlayers", false);
FAKE_PLAYER_CHAT = FakePlayers.getBoolean("FakePlayerChat", false);
FAKE_PLAYER_USE_SHOTS = FakePlayers.getBoolean("FakePlayerUseShots", false);
FAKE_PLAYER_KILL_PVP = FakePlayers.getBoolean("FakePlayerKillsRewardPvP", false);
FAKE_PLAYER_KILL_KARMA = FakePlayers.getBoolean("FakePlayerUnflaggedKillsKarma", false);
FAKE_PLAYER_AGGRO_MONSTERS = FakePlayers.getBoolean("FakePlayerAggroMonsters", false);
FAKE_PLAYER_AGGRO_PLAYERS = FakePlayers.getBoolean("FakePlayerAggroPlayers", false);
FAKE_PLAYER_AGGRO_FPC = FakePlayers.getBoolean("FakePlayerAggroFPC", false);
FAKE_PLAYER_CAN_DROP_ITEMS = FakePlayers.getBoolean("FakePlayerCanDropItems", false);
FAKE_PLAYER_CAN_PICKUP = FakePlayers.getBoolean("FakePlayerCanPickup", false);
// Load FindPvP config file (if exists)
final PropertiesParser FindPvP = new PropertiesParser(CUSTOM_FIND_PVP_CONFIG_FILE);
@ -3250,7 +3250,7 @@ public class Config
{
try
{
PREMIUM_RATE_DROP_CHANCE_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
PREMIUM_RATE_DROP_CHANCE_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -3277,7 +3277,7 @@ public class Config
{
try
{
PREMIUM_RATE_DROP_AMOUNT_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
PREMIUM_RATE_DROP_AMOUNT_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -3354,7 +3354,7 @@ public class Config
MOBS_LIST_NOT_RANDOM = new ArrayList<>(mobsIds.length);
for (String id : mobsIds)
{
MOBS_LIST_NOT_RANDOM.add(Integer.valueOf(id));
MOBS_LIST_NOT_RANDOM.add(Integer.parseInt(id));
}
}

View File

@ -32,7 +32,7 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
*/
public class NetworkManager
{
private final Logger LOGGER = Logger.getLogger(getClass().getName());
private static final Logger LOGGER = Logger.getLogger(NetworkManager.class.getName());
private final ServerBootstrap _serverBootstrap;
private final String _host;

View File

@ -33,7 +33,7 @@ import org.l2jmobius.Config;
*/
public class DeadLockDetector extends Thread
{
private static Logger LOGGER = Logger.getLogger(DeadLockDetector.class.getName());
private static final Logger LOGGER = Logger.getLogger(DeadLockDetector.class.getName());
private final Duration _checkInterval;
private final Runnable _deadLockCallback;

View File

@ -104,12 +104,10 @@ public interface IXmlReader
catch (SAXParseException e)
{
LOGGER.log(Level.WARNING, "Could not parse file: " + f.getName() + " at line: " + e.getLineNumber() + ", column: " + e.getColumnNumber() + " :", e);
return;
}
catch (Exception e)
{
LOGGER.log(Level.WARNING, "Could not parse file: " + f.getName(), e);
return;
}
}
@ -178,10 +176,7 @@ public interface IXmlReader
}
else if (getCurrentFileFilter().accept(file))
{
jobs.add(ThreadPool.schedule(() ->
{
parseFile(file);
}, 0));
jobs.add(ThreadPool.schedule(() -> parseFile(file), 0));
}
}
while (!jobs.isEmpty())

View File

@ -24,7 +24,7 @@ import java.util.logging.Logger;
public class ScrambledKeyPair
{
private static Logger LOGGER = Logger.getLogger(ScrambledKeyPair.class.getName());
private static final Logger LOGGER = Logger.getLogger(ScrambledKeyPair.class.getName());
private final KeyPair _pair;
private final byte[] _scrambledModulus;

View File

@ -30,7 +30,7 @@ import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
*/
public class FortUpdater implements Runnable
{
private static Logger LOGGER = Logger.getLogger(FortUpdater.class.getName());
private static final Logger LOGGER = Logger.getLogger(FortUpdater.class.getName());
private final Clan _clan;
private final Fort _fort;
private int _runCount;

View File

@ -32,7 +32,7 @@ import org.l2jmobius.gameserver.communitybbs.Manager.PostBBSManager;
*/
public class Post
{
private static Logger LOGGER = Logger.getLogger(Post.class.getName());
private static final Logger LOGGER = Logger.getLogger(Post.class.getName());
public static class CPost
{

View File

@ -30,7 +30,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
public class ForumsBBSManager extends BaseBBSManager
{
private static Logger LOGGER = Logger.getLogger(ForumsBBSManager.class.getName());
private static final Logger LOGGER = Logger.getLogger(ForumsBBSManager.class.getName());
private final Collection<Forum> _table;
private int _lastid = 1;

View File

@ -40,7 +40,7 @@ import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
*/
public class AnnouncementsTable
{
private static Logger LOGGER = Logger.getLogger(AnnouncementsTable.class.getName());
private static final Logger LOGGER = Logger.getLogger(AnnouncementsTable.class.getName());
private final Map<Integer, IAnnouncement> _announcements = new ConcurrentSkipListMap<>();

View File

@ -37,7 +37,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
*/
public class CharNameTable
{
private static Logger LOGGER = Logger.getLogger(CharNameTable.class.getName());
private static final Logger LOGGER = Logger.getLogger(CharNameTable.class.getName());
private final Map<Integer, String> _chars = new ConcurrentHashMap<>();
private final Map<Integer, Integer> _accessLevels = new ConcurrentHashMap<>();

View File

@ -197,7 +197,7 @@ public class ClanTable
player.setPledgeClass(ClanMember.calculatePledgeClass(player));
player.setClanPrivileges(new EnumIntBitmask<>(ClanPrivilege.class, true));
_clans.put(Integer.valueOf(clan.getId()), clan);
_clans.put(clan.getId(), clan);
// should be update packet only
player.sendPacket(new PledgeShowInfoUpdate(clan));

View File

@ -38,7 +38,7 @@ import org.l2jmobius.gameserver.network.GameClient;
public class OfflineTradersTable
{
private static Logger LOGGER = Logger.getLogger(OfflineTradersTable.class.getName());
private static final Logger LOGGER = Logger.getLogger(OfflineTradersTable.class.getName());
// SQL DEFINITIONS
private static final String SAVE_OFFLINE_STATUS = "INSERT INTO character_offline_trade (`charId`,`time`,`type`,`title`) VALUES (?,?,?,?)";

View File

@ -32,7 +32,7 @@ import org.l2jmobius.gameserver.data.xml.impl.PetDataTable;
public class PetNameTable
{
private static Logger LOGGER = Logger.getLogger(PetNameTable.class.getName());
private static final Logger LOGGER = Logger.getLogger(PetNameTable.class.getName());
public static PetNameTable getInstance()
{

View File

@ -37,7 +37,7 @@ import org.l2jmobius.gameserver.model.holders.FakePlayerHolder;
*/
public class FakePlayerData implements IXmlReader
{
private static Logger LOGGER = Logger.getLogger(FakePlayerData.class.getName());
private static final Logger LOGGER = Logger.getLogger(FakePlayerData.class.getName());
private final Map<Integer, FakePlayerHolder> _fakePlayerInfos = new HashMap<>();
private final Map<String, String> _fakePlayerNames = new HashMap<>();

View File

@ -81,7 +81,7 @@ public class PetDataTable implements IXmlReader
{
for (String foodId : attrs.getNamedItem("val").getNodeValue().split(";"))
{
data.addFood(Integer.valueOf(foodId));
data.addFood(Integer.parseInt(foodId));
}
}
else if ("load".equals(type))

View File

@ -36,7 +36,7 @@ import org.l2jmobius.gameserver.model.holders.SkillHolder;
*/
public class PetSkillData implements IXmlReader
{
private static Logger LOGGER = Logger.getLogger(PetSkillData.class.getName());
private static final Logger LOGGER = Logger.getLogger(PetSkillData.class.getName());
private final Map<Integer, Map<Long, SkillHolder>> _skillTrees = new HashMap<>();
protected PetSkillData()

View File

@ -262,7 +262,7 @@ public class SkillTreesData implements IXmlReader
}
case "residenceId":
{
skillLearn.addResidenceId(Integer.valueOf(b.getTextContent()));
skillLearn.addResidenceId(Integer.parseInt(b.getTextContent()));
break;
}
case "socialClass":

View File

@ -55,7 +55,7 @@ import org.l2jmobius.gameserver.util.GMAudit;
*/
public class ItemTable
{
private static Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static final Logger LOGGER = Logger.getLogger(ItemTable.class.getName());
private static Logger LOGGER_ITEMS = Logger.getLogger("item");
public static final Map<String, Integer> SLOTS = new HashMap<>();

View File

@ -143,7 +143,7 @@ public class DocumentItem extends DocumentBase implements IXmlReader
if ("stat".equalsIgnoreCase(b.getNodeName()))
{
final Stats type = Stats.valueOfXml(b.getAttributes().getNamedItem("type").getNodeValue());
final double value = Double.valueOf(b.getTextContent());
final double value = Double.parseDouble(b.getTextContent());
_currentItem.item.addFunctionTemplate(new FuncTemplate(null, null, "add", 0x00, type, value));
}
}

View File

@ -32,7 +32,7 @@ public enum IllegalActionPunishmentType
{
for (IllegalActionPunishmentType type : values())
{
if (type.name().toLowerCase().equals(name.toLowerCase()))
if (type.name().equalsIgnoreCase(name.toLowerCase()))
{
return type;
}

View File

@ -158,7 +158,7 @@ public class AntiFeedManager
return false; // no such event registered
}
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
final Integer addrHash = client.getConnectionAddress().hashCode();
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS)
@ -211,8 +211,7 @@ public class AntiFeedManager
return false; // no such event registered
}
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
final Integer addrHash = client.getConnectionAddress().hashCode();
return event.computeIfPresent(addrHash, (k, v) ->
{
if ((v == null) || (v.decrementAndGet() == 0))
@ -275,7 +274,7 @@ public class AntiFeedManager
return max;
}
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
final Integer addrHash = client.getConnectionAddress().hashCode();
int limit = max;
if (Config.DUALBOX_CHECK_WHITELIST.containsKey(addrHash))
{

View File

@ -35,7 +35,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
*/
public class FactionManager
{
private static Logger LOGGER = Logger.getLogger(FactionManager.class.getName());
private static final Logger LOGGER = Logger.getLogger(FactionManager.class.getName());
private final Map<Integer, Integer> _playerFactions = new ConcurrentHashMap<>();
protected FactionManager()

View File

@ -43,7 +43,7 @@ import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
*/
public class FakePlayerChatManager implements IXmlReader
{
private static Logger LOGGER = Logger.getLogger(FakePlayerChatManager.class.getName());
private static final Logger LOGGER = Logger.getLogger(FakePlayerChatManager.class.getName());
final List<FakePlayerChatHolder> MESSAGES = new ArrayList<>();
private static final int MIN_DELAY = 5000;
private static final int MAX_DELAY = 15000;

View File

@ -47,7 +47,7 @@ public class GrandBossManager implements IStorable
private static final String UPDATE_GRAND_BOSS_DATA = "UPDATE grandboss_data set loc_x = ?, loc_y = ?, loc_z = ?, heading = ?, respawn_time = ?, currentHP = ?, currentMP = ?, status = ? where boss_id = ?";
private static final String UPDATE_GRAND_BOSS_DATA2 = "UPDATE grandboss_data set status = ? where boss_id = ?";
protected static Logger LOGGER = Logger.getLogger(GrandBossManager.class.getName());
protected static final Logger LOGGER = Logger.getLogger(GrandBossManager.class.getName());
protected static Map<Integer, GrandBossInstance> _bosses = new ConcurrentHashMap<>();

View File

@ -35,7 +35,7 @@ import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
public class BlockList
{
private static Logger LOGGER = Logger.getLogger(BlockList.class.getName());
private static final Logger LOGGER = Logger.getLogger(BlockList.class.getName());
private static final Map<Integer, List<Integer>> OFFLINE_LIST = new ConcurrentHashMap<>();
private final PlayerInstance _owner;

View File

@ -36,7 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ShortCutRegister;
public class ShortCuts implements IRestorable
{
private static Logger LOGGER = Logger.getLogger(ShortCuts.class.getName());
private static final Logger LOGGER = Logger.getLogger(ShortCuts.class.getName());
private static final int MAX_SHORTCUTS_PER_BAR = 12;
private final PlayerInstance _owner;
private final Map<Integer, Shortcut> _shortCuts = new TreeMap<>();

View File

@ -28,7 +28,7 @@ import org.l2jmobius.commons.util.Rnd;
*/
public class Territory
{
private static Logger LOGGER = Logger.getLogger(Territory.class.getName());
private static final Logger LOGGER = Logger.getLogger(Territory.class.getName());
protected static class Point
{

View File

@ -162,7 +162,7 @@ public class TeleporterInstance extends Npc
final String token = st.nextToken();
if (Util.isDigit(token))
{
return Integer.valueOf(token);
return Integer.parseInt(token);
}
}
return defaultVal;

View File

@ -54,7 +54,7 @@ import org.l2jmobius.gameserver.util.Util;
*/
public class VillageMasterInstance extends NpcInstance
{
private static Logger LOGGER = Logger.getLogger(VillageMasterInstance.class.getName());
private static final Logger LOGGER = Logger.getLogger(VillageMasterInstance.class.getName());
public VillageMasterInstance(NpcTemplate template)
{

View File

@ -1322,7 +1322,7 @@ public class Olympiad extends ListenersContainer
*/
public static StatsSet addNobleStats(int charId, StatsSet data)
{
return NOBLES.put(Integer.valueOf(charId), data);
return NOBLES.put(charId, data);
}
public static Olympiad getInstance()

View File

@ -95,7 +95,7 @@ public class OlympiadManager
private boolean isRegistered(PlayerInstance noble, PlayerInstance player, boolean showMessage)
{
final Integer objId = Integer.valueOf(noble.getObjectId());
final Integer objId = noble.getObjectId();
if (_nonClassBasedRegisters.contains(objId))
{
if (showMessage)
@ -281,7 +281,7 @@ public class OlympiadManager
return false;
}
final Integer objId = Integer.valueOf(noble.getObjectId());
final Integer objId = noble.getObjectId();
if (_nonClassBasedRegisters.remove(objId))
{
if (Config.DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP > 0)
@ -316,7 +316,7 @@ public class OlympiadManager
task.getGame().handleDisconnect(player);
}
final Integer objId = Integer.valueOf(player.getObjectId());
final Integer objId = player.getObjectId();
if (_nonClassBasedRegisters.remove(objId))
{
return;

View File

@ -239,7 +239,7 @@ public class PunishmentTask implements Runnable
if (_type == PunishmentType.CHAT_BAN && _affect == PunishmentAffect.CHARACTER)
{
final PlayerInstance player = World.getInstance().getPlayer(Integer.valueOf(_key));
final PlayerInstance player = World.getInstance().getPlayer(Integer.parseInt(_key));
if (player != null)
{
player.getEffectList().stopAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);

View File

@ -42,7 +42,7 @@ import org.l2jmobius.gameserver.model.zone.type.ResidenceZone;
*/
public abstract class AbstractResidence extends ListenersContainer implements INamable
{
private final Logger LOGGER = Logger.getLogger(getClass().getName());
private static final Logger LOGGER = Logger.getLogger(AbstractResidence.class.getName());
private final int _residenceId;
private String _name;

View File

@ -58,7 +58,7 @@ public class Hopzone extends VoteSystem
{
if (line.contains("<li><span class=\"rank anonymous tooltip\" title"))
{
int votes = Integer.valueOf(line.split(">")[2].replace("</span", ""));
int votes = Integer.parseInt(line.split(">")[2].replace("</span", ""));
return votes;
}
}

View File

@ -58,7 +58,7 @@ public class Network extends VoteSystem
{
if (line.contains("<div class=\"tls-in-sts\"><b style"))
{
int votes = Integer.valueOf(line.split(">")[2].replace("</b", ""));
int votes = Integer.parseInt(line.split(">")[2].replace("</b", ""));
return votes;
}
}

View File

@ -56,7 +56,7 @@ public class Topzone extends VoteSystem
String line;
while ((line = br.readLine()) != null)
{
int votes = Integer.valueOf(line);
int votes = Integer.parseInt(line);
return votes;
}

View File

@ -31,7 +31,7 @@ import io.netty.channel.socket.nio.NioSocketChannel;
*/
public class LoginServerNetworkManager
{
private final Logger LOGGER = Logger.getLogger(getClass().getName());
private static final Logger LOGGER = Logger.getLogger(LoginServerNetworkManager.class.getName());
private final Bootstrap _bootstrap;

View File

@ -29,7 +29,7 @@ import org.l2jmobius.commons.network.BaseSendablePacket;
*/
public class BlowFishKey extends BaseSendablePacket
{
private static Logger LOGGER = Logger.getLogger(BlowFishKey.class.getName());
private static final Logger LOGGER = Logger.getLogger(BlowFishKey.class.getName());
/**
* @param blowfishKey

View File

@ -42,7 +42,7 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class CharSelectionInfo implements IClientOutgoingPacket
{
private static Logger LOGGER = Logger.getLogger(CharSelectionInfo.class.getName());
private static final Logger LOGGER = Logger.getLogger(CharSelectionInfo.class.getName());
private final String _loginName;
private final int _sessionId;
private int _activeId;

View File

@ -120,7 +120,7 @@ public class TelnetServerHandler extends ChannelInboundHandlerAdapter
{
response = "Type 'help' to see all available commands." + Config.EOL;
}
else if (request.toLowerCase().equals("exit"))
else if (request.equalsIgnoreCase("exit"))
{
response = "Have a good day!" + Config.EOL;
close = true;

View File

@ -41,7 +41,7 @@ import org.l2jmobius.gameserver.util.Util;
*/
public class SecondaryPasswordAuth
{
private final Logger LOGGER = Logger.getLogger(SecondaryPasswordAuth.class.getName());
private static final Logger LOGGER = Logger.getLogger(SecondaryPasswordAuth.class.getName());
private final GameClient _activeClient;
private String _password;

View File

@ -226,14 +226,14 @@ public class TaskManager
}
case TYPE_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
delay = Long.parseLong(task.getParams()[0]);
task.scheduled = ThreadPool.schedule(task, delay);
return true;
}
case TYPE_FIXED_SHEDULED:
{
delay = Long.valueOf(task.getParams()[0]);
interval = Long.valueOf(task.getParams()[1]);
delay = Long.parseLong(task.getParams()[0]);
interval = Long.parseLong(task.getParams()[1]);
task.scheduled = ThreadPool.scheduleAtFixedRate(task, delay, interval);
return true;
}
@ -267,7 +267,7 @@ public class TaskManager
}
case TYPE_GLOBAL_TASK:
{
interval = Long.valueOf(task.getParams()[0]) * 86400000;
interval = Long.parseLong(task.getParams()[0]) * 86400000;
final String[] hour = task.getParams()[1].split(":");
if (hour.length != 3)

View File

@ -114,7 +114,7 @@ public class Gui
final String input = ((String) answer).trim();
if (Util.isDigit(input))
{
final int delay = Integer.valueOf(input);
final int delay = Integer.parseInt(input);
if (delay > 0)
{
Shutdown.getInstance().startShutdown(null, delay, false);
@ -137,7 +137,7 @@ public class Gui
final String input = ((String) answer).trim();
if (Util.isDigit(input))
{
final int delay = Integer.valueOf(input);
final int delay = Integer.parseInt(input);
if (delay > 0)
{
Shutdown.getInstance().startShutdown(null, delay, true);

View File

@ -35,7 +35,7 @@ import org.l2jmobius.gameserver.network.serverpackets.RelationChanged;
*/
public class Broadcast
{
private static Logger LOGGER = Logger.getLogger(Broadcast.class.getName());
private static final Logger LOGGER = Logger.getLogger(Broadcast.class.getName());
/**
* Send a packet to all PlayerInstance in the _KnownPlayers of the Creature that have the Character targeted.<BR>

View File

@ -73,7 +73,7 @@ public class Expression
public Expression setVariable(String name, double value)
{
checkVariableName(name);
variables.put(name, Double.valueOf(value));
variables.put(name, value);
return this;
}

View File

@ -32,7 +32,7 @@ import org.l2jmobius.Config;
*/
public abstract class FloodProtectedListener extends Thread
{
private final Logger LOGGER = Logger.getLogger(FloodProtectedListener.class.getName());
private static final Logger LOGGER = Logger.getLogger(FloodProtectedListener.class.getName());
private final Map<String, ForeignConnection> _floodProtection = new ConcurrentHashMap<>();
private ServerSocket _serverSocket;

View File

@ -38,7 +38,7 @@ import org.l2jmobius.loginserver.network.loginserverpackets.LoginServerFail;
*/
public class GameServerPacketHandler
{
protected static Logger LOGGER = Logger.getLogger(GameServerPacketHandler.class.getName());
protected static final Logger LOGGER = Logger.getLogger(GameServerPacketHandler.class.getName());
public enum GameServerState
{

View File

@ -43,7 +43,7 @@ import org.l2jmobius.loginserver.network.serverpackets.ServerList;
*/
public class RequestAuthLogin implements IIncomingPacket<LoginClient>
{
private static Logger LOGGER = Logger.getLogger(RequestAuthLogin.class.getName());
private static final Logger LOGGER = Logger.getLogger(RequestAuthLogin.class.getName());
private final byte[] _raw1 = new byte[128];
private final byte[] _raw2 = new byte[128];

View File

@ -40,7 +40,7 @@ import org.l2jmobius.loginserver.network.serverpackets.ServerList;
public class RequestCmdLogin implements IIncomingPacket<LoginClient>
{
private static Logger LOGGER = Logger.getLogger(RequestCmdLogin.class.getName());
private static final Logger LOGGER = Logger.getLogger(RequestCmdLogin.class.getName());
private final byte[] _raw = new byte[128];

View File

@ -27,7 +27,7 @@ import org.l2jmobius.loginserver.LoginController;
*/
public class ChangeAccessLevel extends BaseRecievePacket
{
protected static Logger LOGGER = Logger.getLogger(ChangeAccessLevel.class.getName());
protected static final Logger LOGGER = Logger.getLogger(ChangeAccessLevel.class.getName());
/**
* @param decrypt

View File

@ -35,7 +35,7 @@ import org.l2jmobius.loginserver.GameServerThread;
*/
public class ChangePassword extends BaseRecievePacket
{
protected static Logger LOGGER = Logger.getLogger(ChangePassword.class.getName());
protected static final Logger LOGGER = Logger.getLogger(ChangePassword.class.getName());
private static GameServerThread gst = null;
public ChangePassword(byte[] decrypt)

View File

@ -45,7 +45,7 @@ import org.l2jmobius.loginserver.network.loginserverpackets.LoginServerFail;
*/
public class GameServerAuth extends BaseRecievePacket
{
protected static Logger LOGGER = Logger.getLogger(GameServerAuth.class.getName());
protected static final Logger LOGGER = Logger.getLogger(GameServerAuth.class.getName());
GameServerThread _server;
private final byte[] _hexId;
private final int _desiredId;

View File

@ -26,7 +26,7 @@ import org.l2jmobius.loginserver.GameServerThread;
*/
public class PlayerLogout extends BaseRecievePacket
{
protected static Logger LOGGER = Logger.getLogger(PlayerLogout.class.getName());
protected static final Logger LOGGER = Logger.getLogger(PlayerLogout.class.getName());
/**
* @param decrypt

View File

@ -26,7 +26,7 @@ import org.l2jmobius.loginserver.LoginController;
*/
public class PlayerTracert extends BaseRecievePacket
{
protected static Logger LOGGER = Logger.getLogger(PlayerTracert.class.getName());
protected static final Logger LOGGER = Logger.getLogger(PlayerTracert.class.getName());
/**
* @param decrypt

View File

@ -28,7 +28,7 @@ import org.l2jmobius.loginserver.GameServerThread;
*/
public class ServerStatus extends BaseRecievePacket
{
protected static Logger LOGGER = Logger.getLogger(ServerStatus.class.getName());
protected static final Logger LOGGER = Logger.getLogger(ServerStatus.class.getName());
public static final int SERVER_LIST_STATUS = 0x01;
public static final int SERVER_TYPE = 0x02;

View File

@ -110,7 +110,7 @@ public class Nottingale extends AbstractNpcAI
case "32627-09.html":
case "32627-10.html":
{
player.sendPacket(RADARS.get(Integer.valueOf(event.substring(6, 8))));
player.sendPacket(RADARS.get(Integer.parseInt(event.substring(6, 8))));
htmltext = event;
break;
}

View File

@ -163,7 +163,7 @@ public class MentorGuide extends AbstractNpcAI implements IXmlReader
final String[] params = event.split(" ");
if (Util.isDigit(params[1]))
{
final int objectId = Integer.valueOf(params[1]);
final int objectId = Integer.parseInt(params[1]);
MentorManager.getInstance().getMentees(objectId).stream().filter(Objects::nonNull).filter(Mentee::isOnline).forEach(mentee ->
{
final PlayerInstance menteePlayer = mentee.getPlayerInstance();

View File

@ -241,7 +241,7 @@ public class Race extends Event
}
else
{
final int _number = Integer.valueOf(bypass.substring(5));
final int _number = Integer.parseInt(bypass.substring(5));
final Skill _sk = SkillData.getInstance().getSkill(_number, 1);
if (_sk != null)
{
@ -258,7 +258,7 @@ public class Race extends Event
}
else if (bypass.startsWith("tele"))
{
if ((Integer.valueOf(bypass.substring(4)) > 0) && (_randspawn != null))
if ((Integer.parseInt(bypass.substring(4)) > 0) && (_randspawn != null))
{
player.teleToLocation(_randspawn[0], _randspawn[1], _randspawn[2]);
}

View File

@ -256,17 +256,17 @@ public class AdminAdmin implements IAdminCommandHandler
{
case "RateXp":
{
Config.RATE_XP = Float.valueOf(pValue);
Config.RATE_XP = Float.parseFloat(pValue);
break;
}
case "RateSp":
{
Config.RATE_SP = Float.valueOf(pValue);
Config.RATE_SP = Float.parseFloat(pValue);
break;
}
case "RateDropSpoil":
{
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.parseFloat(pValue);
break;
}
}

View File

@ -454,7 +454,7 @@ public class AdminAnnouncements implements IAdminCommandHandler
final String token = st.nextToken();
if (Util.isDigit(token))
{
page = Integer.valueOf(token);
page = Integer.parseInt(token);
}
}

View File

@ -56,7 +56,7 @@ public class AdminClanHall implements IAdminCommandHandler
final StringTokenizer st = new StringTokenizer(command, " ");
final String actualCommand = st.nextToken();
if (actualCommand.toLowerCase().equals("admin_clanhall"))
if (actualCommand.equalsIgnoreCase("admin_clanhall"))
{
processBypass(activeChar, new BypassParser(command));
}

View File

@ -67,7 +67,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminEditChar implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminEditChar.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminEditChar.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@ -33,7 +33,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminEnchant implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminEnchant.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminEnchant.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@ -33,7 +33,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminHeal implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminRes.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminRes.class.getName());
private static final String[] ADMIN_COMMANDS =
{
"admin_heal"

View File

@ -70,7 +70,7 @@ public class AdminPcCondOverride implements IAdminCommandHandler
final String token = st.nextToken();
if (Util.isDigit(token))
{
final PlayerCondOverride ex = PlayerCondOverride.getCondOverride(Integer.valueOf(token));
final PlayerCondOverride ex = PlayerCondOverride.getCondOverride(Integer.parseInt(token));
if (ex != null)
{
if (activeChar.canOverrideCond(ex))

View File

@ -32,7 +32,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
*/
public class AdminRepairChar implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminRepairChar.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminRepairChar.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@ -50,7 +50,7 @@ public class AdminShutdown implements IAdminCommandHandler
final String val = command.substring(22);
if (Util.isDigit(val))
{
serverShutdown(activeChar, Integer.valueOf(val), false);
serverShutdown(activeChar, Integer.parseInt(val), false);
}
else
{

View File

@ -60,7 +60,7 @@ import org.l2jmobius.gameserver.util.BuilderUtil;
*/
public class AdminSkill implements IAdminCommandHandler
{
private static Logger LOGGER = Logger.getLogger(AdminSkill.class.getName());
private static final Logger LOGGER = Logger.getLogger(AdminSkill.class.getName());
private static final String[] ADMIN_COMMANDS =
{

View File

@ -127,7 +127,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "01"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "01"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());
@ -147,7 +147,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() : "<fstring>" + quest.getNpcStringId() + "01</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "01"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "01"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());
@ -172,7 +172,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() + " (In Progress)" : "<fstring>" + quest.getNpcStringId() + "02</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "02"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "02"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());
@ -192,7 +192,7 @@ public class QuestLink implements IBypassHandler
String localisation = quest.isCustomQuest() ? quest.getPath() + " (Done) " : "<fstring>" + quest.getNpcStringId() + "03</fstring>";
if (Config.MULTILANG_ENABLE)
{
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.valueOf(quest.getNpcStringId() + "03"));
final NpcStringId ns = NpcStringId.getNpcStringId(Integer.parseInt(quest.getNpcStringId() + "03"));
if (ns != null)
{
final NSLocalisation nsl = ns.getLocalisation(player.getLang());

View File

@ -80,7 +80,7 @@ public class PetFood implements IItemHandler
if (player.isMounted())
{
final List<Integer> foodIds = PetDataTable.getInstance().getPetData(player.getMountNpcId()).getFood();
if (foodIds.contains(Integer.valueOf(item.getId())))
if (foodIds.contains(item.getId()))
{
if (player.destroyItem("Consume", item.getObjectId(), 1, null, false))
{

View File

@ -135,7 +135,7 @@ public class Q00617_GatherTheFlames extends Quest
{
return getNoQuestMsg(player);
}
giveItems(player, Integer.valueOf(event), 1);
giveItems(player, Integer.parseInt(event), 1);
takeItems(player, TORCH, 1200);
htmltext = "32049-04.html";
break;
@ -147,7 +147,7 @@ public class Q00617_GatherTheFlames extends Quest
{
return getNoQuestMsg(player);
}
giveItems(player, Integer.valueOf(event), 1);
giveItems(player, Integer.parseInt(event), 1);
takeItems(player, TORCH, 1200);
htmltext = "32049-03.html";
break;

View File

@ -131,7 +131,7 @@ public class Q10287_StoryOfThoseLeft extends Quest
{
if (qs.isMemoState(2))
{
rewardItems(player, Integer.valueOf(event), 1);
rewardItems(player, Integer.parseInt(event), 1);
htmltext = "32020-09.html";
qs.exitQuest(false, true);
}

View File

@ -2129,7 +2129,7 @@ public class Config
try
{
MINIONS_RESPAWN_TIME.put(Integer.valueOf(propSplit[0]), Integer.valueOf(propSplit[1]));
MINIONS_RESPAWN_TIME.put(Integer.parseInt(propSplit[0]), Integer.parseInt(propSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -2245,7 +2245,7 @@ public class Config
{
try
{
RATE_DROP_AMOUNT_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
RATE_DROP_AMOUNT_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -2273,7 +2273,7 @@ public class Config
{
try
{
RATE_DROP_CHANCE_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
RATE_DROP_CHANCE_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -3135,7 +3135,7 @@ public class Config
final PropertiesParser FactionSystem = new PropertiesParser(CUSTOM_FACTION_SYSTEM_CONFIG_FILE);
String[] tempString;
FACTION_SYSTEM_ENABLED = Boolean.valueOf(FactionSystem.getBoolean("EnableFactionSystem", false));
FACTION_SYSTEM_ENABLED = FactionSystem.getBoolean("EnableFactionSystem", false);
tempString = FactionSystem.getString("StartingLocation", "85332,16199,-1252").split(",");
FACTION_STARTING_LOCATION = new Location(Integer.parseInt(tempString[0]), Integer.parseInt(tempString[1]), Integer.parseInt(tempString[2]));
tempString = FactionSystem.getString("ManagerSpawnLocation", "85712,15974,-1260,26808").split(",");
@ -3157,16 +3157,16 @@ public class Config
// Load FakePlayers config file (if exists)
final PropertiesParser FakePlayers = new PropertiesParser(CUSTOM_FAKE_PLAYERS_CONFIG_FILE);
FAKE_PLAYERS_ENABLED = Boolean.valueOf(FakePlayers.getBoolean("EnableFakePlayers", false));
FAKE_PLAYER_CHAT = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerChat", false));
FAKE_PLAYER_USE_SHOTS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerUseShots", false));
FAKE_PLAYER_KILL_PVP = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerKillsRewardPvP", false));
FAKE_PLAYER_KILL_KARMA = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerUnflaggedKillsKarma", false));
FAKE_PLAYER_AGGRO_MONSTERS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerAggroMonsters", false));
FAKE_PLAYER_AGGRO_PLAYERS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerAggroPlayers", false));
FAKE_PLAYER_AGGRO_FPC = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerAggroFPC", false));
FAKE_PLAYER_CAN_DROP_ITEMS = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerCanDropItems", false));
FAKE_PLAYER_CAN_PICKUP = Boolean.valueOf(FakePlayers.getBoolean("FakePlayerCanPickup", false));
FAKE_PLAYERS_ENABLED = FakePlayers.getBoolean("EnableFakePlayers", false);
FAKE_PLAYER_CHAT = FakePlayers.getBoolean("FakePlayerChat", false);
FAKE_PLAYER_USE_SHOTS = FakePlayers.getBoolean("FakePlayerUseShots", false);
FAKE_PLAYER_KILL_PVP = FakePlayers.getBoolean("FakePlayerKillsRewardPvP", false);
FAKE_PLAYER_KILL_KARMA = FakePlayers.getBoolean("FakePlayerUnflaggedKillsKarma", false);
FAKE_PLAYER_AGGRO_MONSTERS = FakePlayers.getBoolean("FakePlayerAggroMonsters", false);
FAKE_PLAYER_AGGRO_PLAYERS = FakePlayers.getBoolean("FakePlayerAggroPlayers", false);
FAKE_PLAYER_AGGRO_FPC = FakePlayers.getBoolean("FakePlayerAggroFPC", false);
FAKE_PLAYER_CAN_DROP_ITEMS = FakePlayers.getBoolean("FakePlayerCanDropItems", false);
FAKE_PLAYER_CAN_PICKUP = FakePlayers.getBoolean("FakePlayerCanPickup", false);
// Load FindPvP config file (if exists)
final PropertiesParser FindPvP = new PropertiesParser(CUSTOM_FIND_PVP_CONFIG_FILE);
@ -3267,7 +3267,7 @@ public class Config
{
try
{
PREMIUM_RATE_DROP_CHANCE_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
PREMIUM_RATE_DROP_CHANCE_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -3294,7 +3294,7 @@ public class Config
{
try
{
PREMIUM_RATE_DROP_AMOUNT_BY_ID.put(Integer.valueOf(itemSplit[0]), Float.valueOf(itemSplit[1]));
PREMIUM_RATE_DROP_AMOUNT_BY_ID.put(Integer.parseInt(itemSplit[0]), Float.parseFloat(itemSplit[1]));
}
catch (NumberFormatException nfe)
{
@ -3371,7 +3371,7 @@ public class Config
MOBS_LIST_NOT_RANDOM = new ArrayList<>(mobsIds.length);
for (String id : mobsIds)
{
MOBS_LIST_NOT_RANDOM.add(Integer.valueOf(id));
MOBS_LIST_NOT_RANDOM.add(Integer.parseInt(id));
}
}

View File

@ -32,7 +32,7 @@ import io.netty.channel.socket.nio.NioServerSocketChannel;
*/
public class NetworkManager
{
private final Logger LOGGER = Logger.getLogger(getClass().getName());
private static final Logger LOGGER = Logger.getLogger(NetworkManager.class.getName());
private final ServerBootstrap _serverBootstrap;
private final String _host;

View File

@ -33,7 +33,7 @@ import org.l2jmobius.Config;
*/
public class DeadLockDetector extends Thread
{
private static Logger LOGGER = Logger.getLogger(DeadLockDetector.class.getName());
private static final Logger LOGGER = Logger.getLogger(DeadLockDetector.class.getName());
private final Duration _checkInterval;
private final Runnable _deadLockCallback;

View File

@ -104,12 +104,10 @@ public interface IXmlReader
catch (SAXParseException e)
{
LOGGER.log(Level.WARNING, "Could not parse file: " + f.getName() + " at line: " + e.getLineNumber() + ", column: " + e.getColumnNumber() + " :", e);
return;
}
catch (Exception e)
{
LOGGER.log(Level.WARNING, "Could not parse file: " + f.getName(), e);
return;
}
}
@ -178,10 +176,7 @@ public interface IXmlReader
}
else if (getCurrentFileFilter().accept(file))
{
jobs.add(ThreadPool.schedule(() ->
{
parseFile(file);
}, 0));
jobs.add(ThreadPool.schedule(() -> parseFile(file), 0));
}
}
while (!jobs.isEmpty())

View File

@ -24,7 +24,7 @@ import java.util.logging.Logger;
public class ScrambledKeyPair
{
private static Logger LOGGER = Logger.getLogger(ScrambledKeyPair.class.getName());
private static final Logger LOGGER = Logger.getLogger(ScrambledKeyPair.class.getName());
private final KeyPair _pair;
private final byte[] _scrambledModulus;

View File

@ -30,7 +30,7 @@ import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
*/
public class FortUpdater implements Runnable
{
private static Logger LOGGER = Logger.getLogger(FortUpdater.class.getName());
private static final Logger LOGGER = Logger.getLogger(FortUpdater.class.getName());
private final Clan _clan;
private final Fort _fort;
private int _runCount;

View File

@ -32,7 +32,7 @@ import org.l2jmobius.gameserver.communitybbs.Manager.PostBBSManager;
*/
public class Post
{
private static Logger LOGGER = Logger.getLogger(Post.class.getName());
private static final Logger LOGGER = Logger.getLogger(Post.class.getName());
public static class CPost
{

View File

@ -30,7 +30,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
public class ForumsBBSManager extends BaseBBSManager
{
private static Logger LOGGER = Logger.getLogger(ForumsBBSManager.class.getName());
private static final Logger LOGGER = Logger.getLogger(ForumsBBSManager.class.getName());
private final Collection<Forum> _table;
private int _lastid = 1;

View File

@ -40,7 +40,7 @@ import org.l2jmobius.gameserver.network.serverpackets.CreatureSay;
*/
public class AnnouncementsTable
{
private static Logger LOGGER = Logger.getLogger(AnnouncementsTable.class.getName());
private static final Logger LOGGER = Logger.getLogger(AnnouncementsTable.class.getName());
private final Map<Integer, IAnnouncement> _announcements = new ConcurrentSkipListMap<>();

View File

@ -37,7 +37,7 @@ import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
*/
public class CharNameTable
{
private static Logger LOGGER = Logger.getLogger(CharNameTable.class.getName());
private static final Logger LOGGER = Logger.getLogger(CharNameTable.class.getName());
private final Map<Integer, String> _chars = new ConcurrentHashMap<>();
private final Map<Integer, Integer> _accessLevels = new ConcurrentHashMap<>();

View File

@ -197,7 +197,7 @@ public class ClanTable
player.setPledgeClass(ClanMember.calculatePledgeClass(player));
player.setClanPrivileges(new EnumIntBitmask<>(ClanPrivilege.class, true));
_clans.put(Integer.valueOf(clan.getId()), clan);
_clans.put(clan.getId(), clan);
// should be update packet only
player.sendPacket(new PledgeShowInfoUpdate(clan));

Some files were not shown because too many files have changed in this diff Show More