diff options
author | Wesley Wolfe <weswolf@aol.com> | 2013-08-06 20:09:42 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2013-08-06 20:09:42 -0500 |
commit | 71a6a565720eafabb072c9332619c234c0edc0d8 (patch) | |
tree | 33fe850c1a0949e30238326fc6b06db56a481567 /src/test/java | |
parent | 9ba5c79c30750ae69e27967d069af087af82eded (diff) | |
download | craftbukkit-71a6a565720eafabb072c9332619c234c0edc0d8.tar craftbukkit-71a6a565720eafabb072c9332619c234c0edc0d8.tar.gz craftbukkit-71a6a565720eafabb072c9332619c234c0edc0d8.tar.lz craftbukkit-71a6a565720eafabb072c9332619c234c0edc0d8.tar.xz craftbukkit-71a6a565720eafabb072c9332619c234c0edc0d8.zip |
Fix javac workaround in ItemStackTest
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java index 29971394..6140edee 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemStackTest.java @@ -316,20 +316,17 @@ public class ItemStackTest extends AbstractTestingBase { static final Material[] COMPOUND_MATERIALS; static final int NAME_PARAMETER = 2; static { - COMPOUND_MATERIALS = new Object() { // Workaround for JDK5 - Material[] value() { - final ItemFactory factory = CraftItemFactory.instance(); - final Map<Class<? extends ItemMeta>, Material> possibleMaterials = new HashMap<Class<? extends ItemMeta>, Material>(); - for (final Material material : Material.values()) { - final ItemMeta meta = factory.getItemMeta(material); - if (meta == null || possibleMaterials.containsKey(meta.getClass())) - continue; - possibleMaterials.put(meta.getClass(), material); + final ItemFactory factory = CraftItemFactory.instance(); + final Map<Class<? extends ItemMeta>, Material> possibleMaterials = new HashMap<Class<? extends ItemMeta>, Material>(); + ItemMeta meta; + for (final Material material : Material.values()) { + meta = factory.getItemMeta(material); + if (meta == null || possibleMaterials.containsKey(meta.getClass())) + continue; + possibleMaterials.put(meta.getClass(), material); - } - return possibleMaterials.values().toArray(new Material[possibleMaterials.size()]); - } - }.value(); + } + COMPOUND_MATERIALS = possibleMaterials.values().toArray(new Material[possibleMaterials.size()]); } @Parameter(0) public StackProvider provider; |