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

@@ -17,6 +17,7 @@
package ai.bosses.Anais;
import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.model.Location;
@@ -41,7 +42,7 @@ public class Anais extends AbstractNpcAI
// Skill
private static SkillHolder DIVINE_NOVA = new SkillHolder(6326, 1);
// Instances
ArrayList<Npc> _divineBurners = new ArrayList<>(4);
List<Npc> _divineBurners = new ArrayList<>(4);
private PlayerInstance _nextTarget = null;
private Npc _current = null;
private int _pot = 0;

View File

@@ -261,7 +261,7 @@ public class RainbowSpringsChateau extends ClanHallSiegeEngine
protected static Map<Integer, Long> _warDecreesCount = new HashMap<>();
protected static List<Clan> _acceptedClans = new ArrayList<>(4);
private static Map<String, ArrayList<Clan>> _usedTextPassages = new HashMap<>();
private static Map<String, List<Clan>> _usedTextPassages = new HashMap<>();
private static Map<Clan, Integer> _pendingItemToGet = new HashMap<>();
protected static SiegableHall _rainbow;
@@ -545,7 +545,7 @@ public class RainbowSpringsChateau extends ClanHallSiegeEngine
if (_usedTextPassages.containsKey(passage))
{
final ArrayList<Clan> list = _usedTextPassages.get(passage);
final List<Clan> list = _usedTextPassages.get(passage);
if (list.contains(clan))
{
html = "yeti_passage_used.htm";

View File

@@ -781,7 +781,7 @@ public abstract class FlagWar extends ClanHallSiegeEngine
{
try (Connection con = DatabaseFactory.getConnection())
{
final ArrayList<Integer> listInstance = _data.get(clanId).players;
final List<Integer> listInstance = _data.get(clanId).players;
if (listInstance == null)
{
LOGGER.warning(getName() + ": Tried to load unregistered clan with ID " + clanId);
@@ -880,8 +880,8 @@ public abstract class FlagWar extends ClanHallSiegeEngine
{
int flag = 0;
int npc = 0;
ArrayList<Integer> players = new ArrayList<>(18);
ArrayList<PlayerInstance> playersInstance = new ArrayList<>(18);
List<Integer> players = new ArrayList<>(18);
List<PlayerInstance> playersInstance = new ArrayList<>(18);
Spawn warrior = null;
Spawn flagInstance = null;
}

View File

@@ -21,6 +21,7 @@ import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_FOLLOW;
import static org.l2jmobius.gameserver.ai.CtrlIntention.AI_INTENTION_IDLE;
import java.util.ArrayList;
import java.util.List;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.impl.SkillData;
@@ -208,7 +209,7 @@ public class ScarletVanHalisha extends AbstractNpcAI
private Creature getRandomTarget(Npc npc, Skill skill)
{
final ArrayList<Creature> result = new ArrayList<>();
final List<Creature> result = new ArrayList<>();
for (WorldObject obj : World.getInstance().getVisibleObjects(npc, WorldObject.class))
{
if (obj.isPlayable() || (obj instanceof DecoyInstance))