cleanup: use implicit generic type with diamond operator

This commit is contained in:
P0nk
2021-04-08 07:42:10 +02:00
parent 8aa44711e3
commit 5730b3b42d
35 changed files with 108 additions and 121 deletions

View File

@@ -21,7 +21,7 @@
*/
package server.maps;
import java.awt.Point;
import java.awt.*;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -35,7 +35,7 @@ public class MapleFootholdTree {
private MapleFootholdTree ne = null;
private MapleFootholdTree sw = null;
private MapleFootholdTree se = null;
private List<MapleFoothold> footholds = new LinkedList<MapleFoothold>();
private List<MapleFoothold> footholds = new LinkedList<>();
private Point p1;
private Point p2;
private Point center;
@@ -96,7 +96,7 @@ public class MapleFootholdTree {
}
private List<MapleFoothold> getRelevants(Point p) {
return getRelevants(p, new LinkedList<MapleFoothold>());
return getRelevants(p, new LinkedList<>());
}
private List<MapleFoothold> getRelevants(Point p, List<MapleFoothold> list) {
@@ -161,7 +161,7 @@ public class MapleFootholdTree {
public MapleFoothold findBelow(Point p) {
List<MapleFoothold> relevants = getRelevants(p);
List<MapleFoothold> xMatches = new LinkedList<MapleFoothold>();
List<MapleFoothold> xMatches = new LinkedList<>();
for (MapleFoothold fh : relevants) {
if (fh.getX1() <= p.x && fh.getX2() >= p.x) {
xMatches.add(fh);

View File

@@ -82,8 +82,8 @@ public class MapleMap {
private Map<Integer, MapleMapObject> mapobjects = new LinkedHashMap<>();
private Set<Integer> selfDestructives = new LinkedHashSet<>();
private Collection<SpawnPoint> monsterSpawn = Collections.synchronizedList(new LinkedList<SpawnPoint>());
private Collection<SpawnPoint> allMonsterSpawn = Collections.synchronizedList(new LinkedList<SpawnPoint>());
private Collection<SpawnPoint> monsterSpawn = Collections.synchronizedList(new LinkedList<>());
private Collection<SpawnPoint> allMonsterSpawn = Collections.synchronizedList(new LinkedList<>());
private AtomicInteger spawnedMonstersOnMap = new AtomicInteger(0);
private AtomicInteger droppedItemCount = new AtomicInteger(0);
private Collection<MapleCharacter> characters = new LinkedHashSet<>();
@@ -2500,7 +2500,7 @@ public class MapleMap {
broadcastGMSpawnPlayerMapObjectMessage(chr, chr, true);
chr.announce(MaplePacketCreator.getGMEffect(0x10, (byte) 1));
List<Pair<MapleBuffStat, Integer>> dsstat = Collections.singletonList(new Pair<MapleBuffStat, Integer>(MapleBuffStat.DARKSIGHT, 0));
List<Pair<MapleBuffStat, Integer>> dsstat = Collections.singletonList(new Pair<>(MapleBuffStat.DARKSIGHT, 0));
broadcastGMMessage(chr, MaplePacketCreator.giveForeignBuff(chr.getId(), dsstat), false);
} else {
broadcastSpawnPlayerMapObjectMessage(chr, chr, true);
@@ -4346,7 +4346,7 @@ public class MapleMap {
}
public final void addMobSpawn(int mobId, int spendCP) {
this.mobsToSpawn.add(new Pair<Integer, Integer>(mobId, spendCP));
this.mobsToSpawn.add(new Pair<>(mobId, spendCP));
}
public final List<Pair<Integer, Integer>> getMobsToSpawn() {

View File

@@ -37,7 +37,7 @@ import java.util.Map;
public class MapleReactorFactory {
private static MapleDataProvider data = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Reactor.wz"));
private static Map<Integer, MapleReactorStats> reactorStats = new HashMap<Integer, MapleReactorStats>();
private static Map<Integer, MapleReactorStats> reactorStats = new HashMap<>();
public static final MapleReactorStats getReactorS(int rid) {
@@ -70,7 +70,7 @@ public class MapleReactorFactory {
Pair<Integer, Integer> reactItem = null;
int type = MapleDataTool.getIntConvert("type", reactorInfoData);
if (type == 100) { //reactor waits for item
reactItem = new Pair<Integer, Integer>(MapleDataTool.getIntConvert("0", reactorInfoData), MapleDataTool.getIntConvert("1", reactorInfoData, 1));
reactItem = new Pair<>(MapleDataTool.getIntConvert("0", reactorInfoData), MapleDataTool.getIntConvert("1", reactorInfoData, 1));
if (!areaSet) { //only set area of effect for item-triggered reactors once
stats.setTL(MapleDataTool.getPoint("lt", reactorInfoData));
stats.setBR(MapleDataTool.getPoint("rb", reactorInfoData));
@@ -129,7 +129,7 @@ public class MapleReactorFactory {
Pair<Integer, Integer> reactItem = null;
int type = MapleDataTool.getIntConvert("type", fknexon);
if (type == 100) { //reactor waits for item
reactItem = new Pair<Integer, Integer>(MapleDataTool.getIntConvert("0", fknexon), MapleDataTool.getIntConvert("1", fknexon));
reactItem = new Pair<>(MapleDataTool.getIntConvert("0", fknexon), MapleDataTool.getIntConvert("1", fknexon));
if (!areaSet || loadArea) { //only set area of effect for item-triggered reactors once
stats.setTL(MapleDataTool.getPoint("lt", fknexon));
stats.setBR(MapleDataTool.getPoint("rb", fknexon));
@@ -139,7 +139,7 @@ public class MapleReactorFactory {
MapleData activeSkillID = fknexon.getChildByPath("activeSkillID");
List<Integer> skillids = null;
if (activeSkillID != null) {
skillids = new ArrayList<Integer>();
skillids = new ArrayList<>();
for (MapleData skill : activeSkillID.getChildren()) {
skillids.add(MapleDataTool.getInt(skill));
}