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

@@ -135,7 +135,7 @@ public enum ItemFactory {
try (ResultSet rs = ps.executeQuery()) {
while (rs.next()) {
Integer cid = rs.getInt("characterid");
items.add(new Pair<Item, Integer>(loadEquipFromResultSet(rs), cid));
items.add(new Pair<>(loadEquipFromResultSet(rs), cid));
}
}
}
@@ -295,7 +295,7 @@ public enum ItemFactory {
MapleInventoryType mit = MapleInventoryType.getByType(rs.getByte("inventorytype"));
if (mit.equals(MapleInventoryType.EQUIP) || mit.equals(MapleInventoryType.EQUIPPED)) {
items.add(new Pair<Item, MapleInventoryType>(loadEquipFromResultSet(rs), mit));
items.add(new Pair<>(loadEquipFromResultSet(rs), mit));
} else {
if (bundles > 0) {
int petid = rs.getInt("petid");

View File

@@ -36,8 +36,8 @@ import java.util.Map;
*/
public class PetDataFactory {
private static MapleDataProvider dataRoot = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Item.wz"));
private static Map<String, PetCommand> petCommands = new HashMap<String, PetCommand>();
private static Map<Integer, Integer> petHunger = new HashMap<Integer, Integer>();
private static Map<String, PetCommand> petCommands = new HashMap<>();
private static Map<Integer, Integer> petHunger = new HashMap<>();
public static PetCommand getPetCommand(int petId, int skillId) {
PetCommand ret = petCommands.get(petId + "" + skillId);