Used List instead of ArrayList for declarations.

This commit is contained in:
MobiusDevelopment
2020-06-20 18:58:43 +00:00
parent cedd794473
commit 61157a6d03
253 changed files with 819 additions and 624 deletions

View File

@ -1103,7 +1103,7 @@ public class Config
public static long DEADLOCKCHECK_INTIAL_TIME;
public static long DEADLOCKCHECK_DELAY_TIME;
public static ArrayList<String> QUESTION_LIST = new ArrayList<>();
public static List<String> QUESTION_LIST = new ArrayList<>();
public static int SERVER_ID;
public static byte[] HEX_ID;

View File

@ -68,7 +68,7 @@ public class SchemeBufferTable
final int objectId = rs.getInt("object_id");
final String schemeName = rs.getString("scheme_name");
final String[] skills = rs.getString("skills").split(",");
final ArrayList<Integer> schemeList = new ArrayList<>();
final List<Integer> schemeList = new ArrayList<>();
for (String skill : skills)
{
// Don't feed the skills list if the list is empty.

View File

@ -63,9 +63,9 @@ public class AugmentationData
private static final int BASESTAT_MEN = 16344;
private static List<augmentationStat>[] _augmentationStats = null;
private static Map<Integer, ArrayList<augmentationSkill>> _blueSkills = null;
private static Map<Integer, ArrayList<augmentationSkill>> _purpleSkills = null;
private static Map<Integer, ArrayList<augmentationSkill>> _redSkills = null;
private static Map<Integer, List<augmentationSkill>> _blueSkills = null;
private static Map<Integer, List<augmentationSkill>> _purpleSkills = null;
private static Map<Integer, List<augmentationSkill>> _redSkills = null;
private AugmentationData()
{

View File

@ -627,7 +627,7 @@ public abstract class DocumentBase
else if ("class_id_restriction".equalsIgnoreCase(a.getNodeName()))
{
final StringTokenizer st = new StringTokenizer(a.getNodeValue(), ",");
final ArrayList<Integer> array = new ArrayList<>(st.countTokens());
final List<Integer> array = new ArrayList<>(st.countTokens());
while (st.hasMoreTokens())
{
final String item = st.nextToken().trim();

View File

@ -24,8 +24,8 @@ import org.l2jmobius.Config;
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.BankingCmd;
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.CTFCmd;
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.DMCmd;
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.FarmPvpCmd;
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.ExperienceGain;
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.FarmPvpCmd;
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.OfflineShop;
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.Online;
import org.l2jmobius.gameserver.handler.voicedcommandhandlers.StatsCmd;

View File

@ -181,7 +181,7 @@ public class RaidBossPointsManager
tmpPoints.put(ownerId, totalPoints);
}
}
final ArrayList<Entry<Integer, Integer>> list = new ArrayList<>(tmpPoints.entrySet());
final List<Entry<Integer, Integer>> list = new ArrayList<>(tmpPoints.entrySet());
Collections.sort(list, _comparator);
int ranking = 1;
for (Entry<Integer, Integer> entry : list)
@ -209,7 +209,7 @@ public class RaidBossPointsManager
tmpPoints.put(ownerId, totalPoints);
}
}
final ArrayList<Entry<Integer, Integer>> list = new ArrayList<>(tmpPoints.entrySet());
final List<Entry<Integer, Integer>> list = new ArrayList<>(tmpPoints.entrySet());
Collections.sort(list, _comparator);
int ranking = 1;
for (Entry<Integer, Integer> entry : list)

View File

@ -426,7 +426,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
public List<String> getRegisteredClans()
{
final ArrayList<String> clans = new ArrayList<>();
final List<String> clans = new ArrayList<>();
for (clanPlayersInfo a : _clansInfo.values())
{
clans.add(a._clanName);

View File

@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ScheduledFuture;
import java.util.logging.Logger;
@ -63,8 +64,8 @@ public class DevastatedCastle
private NpcInstance _minion1 = null;
private NpcInstance _minion2 = null;
private final ArrayList<MonsterLocation> _monsters = new ArrayList<>();
private ArrayList<Spawn> _spawns = new ArrayList<>();
private final List<MonsterLocation> _monsters = new ArrayList<>();
private List<Spawn> _spawns = new ArrayList<>();
private final Calendar _siegetime = Calendar.getInstance();

View File

@ -145,7 +145,7 @@ public class Calculator
return;
}
final ArrayList<Func> tmp = new ArrayList<>();
final List<Func> tmp = new ArrayList<>();
tmp.addAll(Arrays.asList(_functions));
if (tmp.contains(f))

View File

@ -21,8 +21,8 @@ import org.l2jmobius.gameserver.instancemanager.ClanHallManager;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.entity.ClanHall;
import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
import org.l2jmobius.gameserver.network.serverpackets.ClanHallDecoration;
/**

View File

@ -19,8 +19,8 @@ package org.l2jmobius.gameserver.model.zone.type;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
import org.l2jmobius.gameserver.model.zone.ZoneId;
import org.l2jmobius.gameserver.model.zone.ZoneRespawn;
/**
* A Town zone

View File

@ -18,6 +18,7 @@ package org.l2jmobius.loginserver;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
@ -26,7 +27,7 @@ import org.l2jmobius.Config;
public class BruteProtector
{
private static final Logger LOGGER = Logger.getLogger(BruteProtector.class.getName());
private static final Map<String, ArrayList<Integer>> _clients = new HashMap<>();
private static final Map<String, List<Integer>> _clients = new HashMap<>();
public static boolean canLogin(String ip)
{