[Bleeding] Cleaned up unsafe casts. Addresses BUKKIT-844
Removed internal collection leaks from PluginDescriptionFile BREAKING: PluginDescriptionFile.getAuthors() now returns List instead of ArrayList Various places with unsafe generics, notably List<Object> getList() in Configurations are now referenced as <?>. This is nonbreaking, but sourcecode will need to be revised when compiled. By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
@@ -391,10 +391,9 @@ public class ItemStack implements Cloneable, ConfigurationSerializable {
|
||||
Object raw = args.get("enchantments");
|
||||
|
||||
if (raw instanceof Map) {
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<Object, Object> map = (Map<Object, Object>) raw;
|
||||
Map<?, ?> map = (Map<?, ?>) raw;
|
||||
|
||||
for (Map.Entry<Object, Object> entry : map.entrySet()) {
|
||||
for (Map.Entry<?, ?> entry : map.entrySet()) {
|
||||
Enchantment enchantment = Enchantment.getByName(entry.getKey().toString());
|
||||
|
||||
if ((enchantment != null) && (entry.getValue() instanceof Integer)) {
|
||||
|
||||
Reference in New Issue
Block a user