From 0de92f4db7f62f638186d90bc6b0d2e272867743 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 29 Jul 2014 14:11:41 -0230 Subject: [PATCH] Clean up a bunch of compiler warnings. --- .../mods/fml/client/FMLConfigGuiFactory.java | 5 +- .../fml/client/config/DummyConfigElement.java | 38 ++++-- .../mods/fml/client/config/GuiButtonExt.java | 2 - .../cpw/mods/fml/client/config/GuiConfig.java | 35 +++--- .../fml/client/config/GuiConfigEntries.java | 113 +++++++++++------- .../mods/fml/client/config/GuiEditArray.java | 15 ++- .../client/config/GuiEditArrayEntries.java | 12 +- .../fml/client/config/GuiSelectString.java | 15 ++- .../client/config/GuiSelectStringEntries.java | 9 +- .../cpw/mods/fml/client/config/GuiSlider.java | 1 - .../fml/client/config/IConfigElement.java | 6 +- .../asm/transformers/AccessTransformer.java | 5 - .../transformers/ModAccessTransformer.java | 3 +- .../mods/fml/common/launcher/Yggdrasil.java | 17 +-- 14 files changed, 160 insertions(+), 116 deletions(-) diff --git a/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java b/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java index 84964aa10c..ab22961c8f 100644 --- a/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java +++ b/fml/src/main/java/cpw/mods/fml/client/FMLConfigGuiFactory.java @@ -30,7 +30,8 @@ public class FMLConfigGuiFactory implements IModGuiFactory super(parent, getConfigElements(), "FML", false, false, I18n.format("fml.config.sample.title")); } - private static List getConfigElements() + @SuppressWarnings({ "rawtypes", "unchecked" }) + private static List getConfigElements() { List list = new ArrayList(); List listsList = new ArrayList(); @@ -86,11 +87,9 @@ public class FMLConfigGuiFactory implements IModGuiFactory } } - private Minecraft minecraft; @Override public void initialize(Minecraft minecraftInstance) { - this.minecraft = minecraftInstance; } @Override diff --git a/fml/src/main/java/cpw/mods/fml/client/config/DummyConfigElement.java b/fml/src/main/java/cpw/mods/fml/client/config/DummyConfigElement.java index c77bb2fe4f..16a6ee6346 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/DummyConfigElement.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/DummyConfigElement.java @@ -49,8 +49,10 @@ public class DummyConfigElement implements IConfigElement protected boolean requiresMcRestart = false; protected boolean isListFixedLength = false; protected int maxListLength = -1; - protected List childElements; - protected Class configEntryClass; + @SuppressWarnings("rawtypes") + protected List childElements; + @SuppressWarnings("rawtypes") + protected Class configEntryClass; protected Class arrayEntryClass; /** @@ -59,17 +61,20 @@ public class DummyConfigElement implements IConfigElement */ public static class DummyCategoryElement extends DummyConfigElement { - public DummyCategoryElement(String name, String langKey, List childElements) + @SuppressWarnings("rawtypes") + public DummyCategoryElement(String name, String langKey, List childElements) { - this(name, langKey, childElements, (Class) null); + this(name, langKey, childElements, (Class) null); } - public DummyCategoryElement(String name, String langKey, Class customListEntryClass) + @SuppressWarnings("rawtypes") + public DummyCategoryElement(String name, String langKey, Class customListEntryClass) { this(name, langKey, new ArrayList(), customListEntryClass); } - public DummyCategoryElement(String name, String langKey, List childElements, Class customListEntryClass) + @SuppressWarnings("rawtypes") + public DummyCategoryElement(String name, String langKey, List childElements, Class customListEntryClass) { super(name, (T) null, ConfigGuiType.CONFIG_CATEGORY, langKey); this.childElements = childElements; @@ -144,7 +149,8 @@ public class DummyConfigElement implements IConfigElement this(name, defaultValues, type, langKey, false, maxListLength, validStringPattern, (T) null, (T) null); } - public DummyListElement setCustomEditListEntryClass(Class clazz) + @SuppressWarnings("rawtypes") + public DummyListElement setCustomEditListEntryClass(Class clazz) { this.arrayEntryClass = clazz; return this; @@ -157,7 +163,8 @@ public class DummyConfigElement implements IConfigElement } } - public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, String[] validValues, Pattern validStringPattern, T minValue, T maxValue) + @SuppressWarnings("unchecked") + public DummyConfigElement(String name, T defaultValue, ConfigGuiType type, String langKey, String[] validValues, Pattern validStringPattern, T minValue, T maxValue) { this.name = name; this.defaultValue = defaultValue; @@ -206,7 +213,8 @@ public class DummyConfigElement implements IConfigElement this(name, defaultValue, type, langKey, (String[]) null, (Pattern) null, minValue, maxValue); } - public DummyConfigElement setCustomListEntryClass(Class clazz) + @SuppressWarnings("rawtypes") + public DummyConfigElement setCustomListEntryClass(Class clazz) { this.configEntryClass = clazz; return this; @@ -218,19 +226,22 @@ public class DummyConfigElement implements IConfigElement return isProperty; } - public IConfigElement setConfigEntryClass(Class clazz) + @SuppressWarnings("rawtypes") + public IConfigElement setConfigEntryClass(Class clazz) { this.configEntryClass = clazz; return this; } - @Override + @SuppressWarnings("rawtypes") + @Override public Class getConfigEntryClass() { return configEntryClass; } - public IConfigElement setArrayEntryClass(Class clazz) + @SuppressWarnings("rawtypes") + public IConfigElement setArrayEntryClass(Class clazz) { this.arrayEntryClass = clazz; return this; @@ -266,7 +277,8 @@ public class DummyConfigElement implements IConfigElement return I18n.format(langKey + ".tooltip"); } - @Override + @SuppressWarnings("rawtypes") + @Override public List getChildElements() { return childElements; diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiButtonExt.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiButtonExt.java index 33740fd5d6..1ff93b2bd5 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiButtonExt.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiButtonExt.java @@ -15,8 +15,6 @@ package cpw.mods.fml.client.config; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; -import org.lwjgl.opengl.GL11; - /** * This class provides a button that fixes several bugs present in the vanilla GuiButton drawing code. * The gist of it is that it allows buttons of any size without gaps in the graphics and with the diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiConfig.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiConfig.java index b7e5227889..6a36487e5c 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiConfig.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiConfig.java @@ -12,25 +12,20 @@ package cpw.mods.fml.client.config; -import java.lang.reflect.Method; +import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR; +import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR; + import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiMainMenu; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiYesNo; -import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.resources.I18n; import net.minecraft.util.ChatComponentText; import org.lwjgl.input.Keyboard; -import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR; -import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR; - import cpw.mods.fml.client.config.GuiConfigEntries.IConfigEntry; import cpw.mods.fml.client.event.ConfigChangedEvent; import cpw.mods.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent; @@ -53,8 +48,10 @@ public class GuiConfig extends GuiScreen public final GuiScreen parentScreen; public String title = "Config GUI"; public String titleLine2; - public final List configElements; - public final List initEntries; + @SuppressWarnings("rawtypes") + public final List configElements; + @SuppressWarnings("rawtypes") + public final List initEntries; public GuiConfigEntries entryList; private GuiButtonExt btnDefaultAll; private GuiButtonExt btnUndoAll; @@ -90,7 +87,8 @@ public class GuiConfig extends GuiScreen * @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being * edited. */ - public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, + @SuppressWarnings("rawtypes") + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, boolean allRequireWorldRestart, boolean allRequireMcRestart, String title) { this(parentScreen, configElements, modID, configID, allRequireWorldRestart, allRequireMcRestart, title, null); @@ -108,7 +106,8 @@ public class GuiConfig extends GuiScreen * @param title the desired title for this screen. For consistency it is recommended that you pass the path of the config file being * edited. */ - public GuiConfig(GuiScreen parentScreen, List configElements, String modID, + @SuppressWarnings("rawtypes") + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, boolean allRequireWorldRestart, boolean allRequireMcRestart, String title) { this(parentScreen, configElements, modID, null, allRequireWorldRestart, allRequireMcRestart, title, null); @@ -128,7 +127,8 @@ public class GuiConfig extends GuiScreen * @param titleLine2 the desired title second line for this screen. Typically this is used to send the category name of the category * currently being edited. */ - public GuiConfig(GuiScreen parentScreen, List configElements, String modID, + @SuppressWarnings("rawtypes") + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2) { this(parentScreen, configElements, modID, null, allRequireWorldRestart, allRequireMcRestart, title, titleLine2); @@ -151,7 +151,8 @@ public class GuiConfig extends GuiScreen * @param titleLine2 the desired title second line for this screen. Typically this is used to send the category name of the category * currently being edited. */ - public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, + @SuppressWarnings("rawtypes") + public GuiConfig(GuiScreen parentScreen, List configElements, String modID, String configID, boolean allRequireWorldRestart, boolean allRequireMcRestart, String title, String titleLine2) { this.mc = Minecraft.getMinecraft(); @@ -180,7 +181,8 @@ public class GuiConfig extends GuiScreen return path.replace("\\", "/").replace(mc.mcDataDir.getAbsolutePath().replace("\\", "/"), "/.minecraft"); } - @Override + @SuppressWarnings("unchecked") + @Override public void initGui() { Keyboard.enableRepeatEvents(true); @@ -342,7 +344,8 @@ public class GuiConfig extends GuiScreen this.drawToolTip(this.mc.fontRenderer.listFormattedStringToWidth(I18n.format("fml.configgui.tooltip.applyGlobally"), 300), mouseX, mouseY); } - public void drawToolTip(List stringList, int x, int y) + @SuppressWarnings("rawtypes") + public void drawToolTip(List stringList, int x, int y) { this.func_146283_a(stringList, x, y); } diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiConfigEntries.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiConfigEntries.java index e5f22c5400..b96dbf1e77 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiConfigEntries.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiConfigEntries.java @@ -11,6 +11,9 @@ */ package cpw.mods.fml.client.config; +import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR; +import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR; + import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -18,10 +21,8 @@ import java.util.Map; import java.util.TreeMap; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiListExtended; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.GuiSlot; import net.minecraft.client.gui.GuiTextField; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.resources.I18n; @@ -29,9 +30,6 @@ import net.minecraft.util.EnumChatFormatting; import org.lwjgl.input.Keyboard; -import static cpw.mods.fml.client.config.GuiUtils.RESET_CHAR; -import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR; - import cpw.mods.fml.common.FMLLog; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.ModContainer; @@ -46,7 +44,8 @@ public class GuiConfigEntries extends GuiListExtended { public final GuiConfig owningScreen; public final Minecraft mc; - public List listEntries; + @SuppressWarnings("rawtypes") + public List listEntries; /** * The max width of the label of all IConfigEntry objects. */ @@ -76,15 +75,16 @@ public class GuiConfigEntries extends GuiListExtended */ public int scrollBarX; - public GuiConfigEntries(GuiConfig parent, Minecraft mc) + @SuppressWarnings({ "rawtypes", "unchecked" }) + public GuiConfigEntries(GuiConfig parent, Minecraft mc) { super(mc, parent.width, parent.height, parent.titleLine2 != null ? 33 : 23, parent.height - 32, 20); this.owningScreen = parent; this.setShowSelectionBox(false); this.mc = mc; this.listEntries = new ArrayList(); - int i = 0; - String s = null; +// int i = 0; +// String s = null; for (IConfigElement configElement : parent.configElements) { @@ -168,7 +168,8 @@ public class GuiConfigEntries extends GuiListExtended } } - protected void initGui() + @SuppressWarnings("rawtypes") + protected void initGui() { this.width = owningScreen.width; this.height = owningScreen.height; @@ -205,7 +206,8 @@ public class GuiConfigEntries extends GuiListExtended /** * Gets the IGuiListEntry object for the given index */ - @Override + @SuppressWarnings("rawtypes") + @Override public IConfigEntry getListEntry(int index) { return this.listEntries.get(index); @@ -229,7 +231,8 @@ public class GuiConfigEntries extends GuiListExtended /** * This method is a pass-through for IConfigEntry objects that require keystrokes. Called from the parent GuiConfig screen. */ - public void keyTyped(char eventChar, int eventKey) + @SuppressWarnings("rawtypes") + public void keyTyped(char eventChar, int eventKey) { for (IConfigEntry entry : this.listEntries) entry.keyTyped(eventChar, eventKey); @@ -239,7 +242,8 @@ public class GuiConfigEntries extends GuiListExtended * This method is a pass-through for IConfigEntry objects that contain GuiTextField elements. Called from the parent GuiConfig * screen. */ - public void updateScreen() + @SuppressWarnings("rawtypes") + public void updateScreen() { for (IConfigEntry entry : this.listEntries) entry.updateCursorCounter(); @@ -249,7 +253,8 @@ public class GuiConfigEntries extends GuiListExtended * This method is a pass-through for IConfigEntry objects that contain GuiTextField elements. Called from the parent GuiConfig * screen. */ - public void mouseClicked(int mouseX, int mouseY, int mouseEvent) + @SuppressWarnings("rawtypes") + public void mouseClicked(int mouseX, int mouseY, int mouseEvent) { for (IConfigEntry entry : this.listEntries) entry.mouseClicked(mouseX, mouseY, mouseEvent); @@ -258,7 +263,8 @@ public class GuiConfigEntries extends GuiListExtended /** * This method is a pass-through for IConfigListEntry objects that need to perform actions when the containing GUI is closed. */ - public void onGuiClosed() + @SuppressWarnings("rawtypes") + public void onGuiClosed() { for (IConfigEntry entry : this.listEntries) entry.onGuiClosed(); @@ -268,7 +274,8 @@ public class GuiConfigEntries extends GuiListExtended * Saves all properties on this screen / child screens. This method returns true if any elements were changed that require * a restart for proper handling. */ - public boolean saveConfigElements() + @SuppressWarnings("rawtypes") + public boolean saveConfigElements() { boolean requiresRestart = false; for (IConfigEntry entry : this.listEntries) @@ -282,7 +289,8 @@ public class GuiConfigEntries extends GuiListExtended * Returns true if all IConfigEntry objects on this screen are set to default. If includeChildren is true sub-category * objects are checked as well. */ - public boolean areAllEntriesDefault(boolean includeChildren) + @SuppressWarnings("rawtypes") + public boolean areAllEntriesDefault(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry)) && !entry.isDefault()) @@ -295,7 +303,8 @@ public class GuiConfigEntries extends GuiListExtended * Sets all IConfigEntry objects on this screen to default. If includeChildren is true sub-category objects are set as * well. */ - public void setAllToDefault(boolean includeChildren) + @SuppressWarnings("rawtypes") + public void setAllToDefault(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry))) @@ -306,7 +315,8 @@ public class GuiConfigEntries extends GuiListExtended * Returns true if any IConfigEntry objects on this screen are changed. If includeChildren is true sub-category objects * are checked as well. */ - public boolean hasChangedEntry(boolean includeChildren) + @SuppressWarnings("rawtypes") + public boolean hasChangedEntry(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry)) && entry.isChanged()) @@ -319,7 +329,8 @@ public class GuiConfigEntries extends GuiListExtended * Returns true if any IConfigEntry objects on this screen are enabled. If includeChildren is true sub-category objects * are checked as well. */ - public boolean areAnyEntriesEnabled(boolean includeChildren) + @SuppressWarnings("rawtypes") + public boolean areAnyEntriesEnabled(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry)) && entry.enabled()) @@ -332,7 +343,8 @@ public class GuiConfigEntries extends GuiListExtended * Reverts changes to all IConfigEntry objects on this screen. If includeChildren is true sub-category objects are * reverted as well. */ - public void undoAllChanges(boolean includeChildren) + @SuppressWarnings("rawtypes") + public void undoAllChanges(boolean includeChildren) { for (IConfigEntry entry : this.listEntries) if ((includeChildren || !(entry instanceof CategoryEntry))) @@ -343,7 +355,8 @@ public class GuiConfigEntries extends GuiListExtended * Calls the drawToolTip() method for all IConfigEntry objects on this screen. This is called from the parent GuiConfig screen * after drawing all other elements. */ - public void drawScreenPost(int mouseX, int mouseY, float partialTicks) + @SuppressWarnings("rawtypes") + public void drawScreenPost(int mouseX, int mouseY, float partialTicks) { for (IConfigEntry entry : this.listEntries) entry.drawToolTip(mouseX, mouseY); @@ -414,7 +427,8 @@ public class GuiConfigEntries extends GuiListExtended } } - @Override + @SuppressWarnings("unchecked") + @Override public boolean saveConfigElement() { if (enabled() && isChanged()) @@ -521,7 +535,8 @@ public class GuiConfigEntries extends GuiListExtended } } - @Override + @SuppressWarnings("unchecked") + @Override public boolean saveConfigElement() { if (enabled() && isChanged()) @@ -654,7 +669,8 @@ public class GuiConfigEntries extends GuiListExtended } } - @Override + @SuppressWarnings("unchecked") + @Override public boolean saveConfigElement() { if (enabled() && isChanged()) @@ -689,7 +705,8 @@ public class GuiConfigEntries extends GuiListExtended protected final Object[] beforeValues; protected Object[] currentValues; - public ArrayEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + @SuppressWarnings("rawtypes") + public ArrayEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); beforeValues = configElement.getList(); @@ -754,7 +771,8 @@ public class GuiConfigEntries extends GuiListExtended } } - @Override + @SuppressWarnings("unchecked") + @Override public boolean saveConfigElement() { if (enabled() && isChanged()) @@ -846,7 +864,8 @@ public class GuiConfigEntries extends GuiListExtended } } - @Override + @SuppressWarnings("unchecked") + @Override public boolean saveConfigElement() { if (this.enabled() && this.isChanged()) @@ -967,7 +986,8 @@ public class GuiConfigEntries extends GuiListExtended { protected final int beforeValue; - public IntegerEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + @SuppressWarnings("rawtypes") + public IntegerEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); this.beforeValue = Integer.valueOf(configElement.get().toString()); @@ -1026,7 +1046,8 @@ public class GuiConfigEntries extends GuiListExtended this.textFieldValue.setText(String.valueOf(beforeValue)); } - @Override + @SuppressWarnings("unchecked") + @Override public boolean saveConfigElement() { if (enabled()) @@ -1072,7 +1093,8 @@ public class GuiConfigEntries extends GuiListExtended { protected final double beforeValue; - public DoubleEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + @SuppressWarnings("rawtypes") + public DoubleEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); this.beforeValue = Double.valueOf(configElement.get().toString()); @@ -1132,7 +1154,8 @@ public class GuiConfigEntries extends GuiListExtended this.textFieldValue.setText(String.valueOf(beforeValue)); } - @Override + @SuppressWarnings("unchecked") + @Override public boolean saveConfigElement() { if (enabled()) @@ -1257,7 +1280,8 @@ public class GuiConfigEntries extends GuiListExtended this.textFieldValue.setText(beforeValue); } - @Override + @SuppressWarnings("unchecked") + @Override public boolean saveConfigElement() { if (enabled()) @@ -1300,7 +1324,8 @@ public class GuiConfigEntries extends GuiListExtended protected GuiScreen childScreen; protected final GuiButtonExt btnSelectCategory; - public CategoryEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + @SuppressWarnings("rawtypes") + public CategoryEntry(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { super(owningScreen, owningEntryList, configElement); @@ -1315,7 +1340,8 @@ public class GuiConfigEntries extends GuiListExtended /** * This method is called in the constructor and is used to set the childScreen field. */ - protected GuiScreen buildChildScreen() + @SuppressWarnings("unchecked") + protected GuiScreen buildChildScreen() { return new GuiConfig(this.owningScreen, this.configElement.getChildElements(), this.owningScreen.modID, owningScreen.allRequireWorldRestart || this.configElement.requiresWorldRestart(), @@ -1460,25 +1486,27 @@ public class GuiConfigEntries extends GuiListExtended * * Provides a base entry for others to extend. Handles drawing the prop label (if drawLabel == true) and the Undo/Default buttons. */ - public static abstract class ListEntryBase implements IConfigEntry + @SuppressWarnings("rawtypes") + public static abstract class ListEntryBase implements IConfigEntry { protected final GuiConfig owningScreen; protected final GuiConfigEntries owningEntryList; - protected final IConfigElement configElement; + protected final IConfigElement configElement; protected final Minecraft mc; protected final String name; protected final GuiButtonExt btnUndoChanges; protected final GuiButtonExt btnDefault; - protected List toolTip; - protected List undoToolTip; - protected List defaultToolTip; + protected List toolTip; + protected List undoToolTip; + protected List defaultToolTip; protected boolean isValidValue = true; protected HoverChecker tooltipHoverChecker; protected HoverChecker undoHoverChecker; protected HoverChecker defaultHoverChecker; protected boolean drawLabel; - public ListEntryBase(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) + @SuppressWarnings({ "unchecked" }) + public ListEntryBase(GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement) { this.owningScreen = owningScreen; this.owningEntryList = owningEntryList; @@ -1673,7 +1701,8 @@ public class GuiConfigEntries extends GuiListExtended * Gets the IConfigElement object owned by this entry. * @return */ - public IConfigElement getConfigElement(); + @SuppressWarnings("rawtypes") + public IConfigElement getConfigElement(); /** * Gets the name of the ConfigElement owned by this entry. diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArray.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArray.java index 6b5ef3f9d3..f4d15f8c38 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArray.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArray.java @@ -36,7 +36,8 @@ import org.lwjgl.input.Keyboard; public class GuiEditArray extends GuiScreen { protected GuiScreen parentScreen; - protected IConfigElement configElement; + @SuppressWarnings("rawtypes") + protected IConfigElement configElement; private GuiEditArrayEntries entryList; private GuiButtonExt btnUndoChanges, btnDefault, btnDone; private String title; @@ -46,10 +47,12 @@ public class GuiEditArray extends GuiScreen private final Object[] beforeValues; private Object[] currentValues; private HoverChecker tooltipHoverChecker; - private List toolTip; + @SuppressWarnings("rawtypes") + private List toolTip; protected boolean enabled; - public GuiEditArray(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Object[] currentValues, boolean enabled) + @SuppressWarnings("rawtypes") + public GuiEditArray(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Object[] currentValues, boolean enabled) { this.mc = Minecraft.getMinecraft(); this.parentScreen = parentScreen; @@ -94,7 +97,8 @@ public class GuiEditArray extends GuiScreen } } - @Override + @SuppressWarnings("unchecked") + @Override public void initGui() { this.entryList = new GuiEditArrayEntries(this, this.mc, this.configElement, this.beforeValues, this.currentValues); @@ -197,7 +201,8 @@ public class GuiEditArray extends GuiScreen drawToolTip(this.toolTip, par1, par2); } - public void drawToolTip(List stringList, int x, int y) + @SuppressWarnings("rawtypes") + public void drawToolTip(List stringList, int x, int y) { this.func_146283_a(stringList, x, y); } diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java index 42733aab18..de1f3e388e 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiEditArrayEntries.java @@ -37,11 +37,12 @@ import cpw.mods.fml.common.FMLLog; * * @author bspkrs */ +@SuppressWarnings("rawtypes") public class GuiEditArrayEntries extends GuiListExtended { private GuiEditArray owningGui; public Minecraft mc; - public IConfigElement configElement; + public IConfigElement configElement; public List listEntries; public boolean isDefault; public boolean isChanged; @@ -50,7 +51,8 @@ public class GuiEditArrayEntries extends GuiListExtended public final Object[] beforeValues; public Object[] currentValues; - public GuiEditArrayEntries(GuiEditArray parent, Minecraft mc, IConfigElement configElement, Object[] beforeValues, Object[] currentValues) + @SuppressWarnings("unchecked") + public GuiEditArrayEntries(GuiEditArray parent, Minecraft mc, IConfigElement configElement, Object[] beforeValues, Object[] currentValues) { super(mc, parent.width, parent.height, parent.titleLine2 != null ? (parent.titleLine3 != null ? 43 : 33) : 23, parent.height - 32, 20); this.owningGui = parent; @@ -219,7 +221,8 @@ public class GuiEditArrayEntries extends GuiListExtended return true; } - protected void saveListChanges() + @SuppressWarnings("unchecked") + protected void saveListChanges() { int listLength = configElement.isListLengthFixed() ? listEntries.size() : listEntries.size() - 1; @@ -540,7 +543,8 @@ public class GuiEditArrayEntries extends GuiListExtended protected boolean isValidValue = true; protected boolean isValidated = false; - public BaseEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement) + @SuppressWarnings({ "unchecked" }) + public BaseEntry(GuiEditArray owningScreen, GuiEditArrayEntries owningEntryList, IConfigElement configElement) { this.owningScreen = owningScreen; this.owningEntryList = owningEntryList; diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectString.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectString.java index 39473359d5..410339b699 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectString.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectString.java @@ -33,7 +33,8 @@ import static cpw.mods.fml.client.config.GuiUtils.UNDO_CHAR; public class GuiSelectString extends GuiScreen { protected GuiScreen parentScreen; - protected IConfigElement configElement; + @SuppressWarnings("rawtypes") + protected IConfigElement configElement; private GuiSelectStringEntries entriesList; private GuiButtonExt btnUndoChanges, btnDefault, btnDone; private String title; @@ -44,10 +45,12 @@ public class GuiSelectString extends GuiScreen public final Object beforeValue; public Object currentValue; private HoverChecker tooltipHoverChecker; - private List toolTip; + @SuppressWarnings("rawtypes") + private List toolTip; protected boolean enabled; - public GuiSelectString(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Map selectableValues, Object currentValue, boolean enabled) + @SuppressWarnings("rawtypes") + public GuiSelectString(GuiScreen parentScreen, IConfigElement configElement, int slotIndex, Map selectableValues, Object currentValue, boolean enabled) { this.mc = Minecraft.getMinecraft(); this.parentScreen = parentScreen; @@ -89,7 +92,8 @@ public class GuiSelectString extends GuiScreen } } - @Override + @SuppressWarnings("unchecked") + @Override public void initGui() { this.entriesList = new GuiSelectStringEntries(this, this.mc, this.configElement, this.selectableValues); @@ -165,7 +169,8 @@ public class GuiSelectString extends GuiScreen drawToolTip(this.toolTip, par1, par2); } - public void drawToolTip(List stringList, int x, int y) + @SuppressWarnings("rawtypes") + public void drawToolTip(List stringList, int x, int y) { this.func_146283_a(stringList, x, y); } diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java index 4fdde4b7a7..e16db6ea5d 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiSelectStringEntries.java @@ -34,13 +34,15 @@ public class GuiSelectStringEntries extends GuiListExtended { public GuiSelectString owningScreen; public Minecraft mc; - public IConfigElement configElement; + @SuppressWarnings("rawtypes") + public IConfigElement configElement; public List listEntries; public final Map selectableValues; public int selectedIndex = -1; public int maxEntryWidth = 0; - public GuiSelectStringEntries(GuiSelectString owningScreen, Minecraft mc, IConfigElement configElement, Map selectableValues) + @SuppressWarnings("rawtypes") + public GuiSelectStringEntries(GuiSelectString owningScreen, Minecraft mc, IConfigElement configElement, Map selectableValues) { super(mc, owningScreen.width, owningScreen.height, owningScreen.titleLine2 != null ? (owningScreen.titleLine3 != null ? 43 : 33) : 23, owningScreen.height - 32, 11); @@ -141,7 +143,8 @@ public class GuiSelectStringEntries extends GuiListExtended return owningScreen.currentValue != null ? owningScreen.currentValue.equals(configElement.getDefault()) : configElement.getDefault() == null; } - public void saveChanges() + @SuppressWarnings("unchecked") + public void saveChanges() { if (owningScreen.slotIndex != -1 && owningScreen.parentScreen != null && owningScreen.parentScreen instanceof GuiConfig diff --git a/fml/src/main/java/cpw/mods/fml/client/config/GuiSlider.java b/fml/src/main/java/cpw/mods/fml/client/config/GuiSlider.java index 3a85f8f508..467a793c0c 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/GuiSlider.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/GuiSlider.java @@ -1,7 +1,6 @@ package cpw.mods.fml.client.config; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.GuiButton; import org.lwjgl.opengl.GL11; diff --git a/fml/src/main/java/cpw/mods/fml/client/config/IConfigElement.java b/fml/src/main/java/cpw/mods/fml/client/config/IConfigElement.java index 9876b3671e..e6a262ec7c 100644 --- a/fml/src/main/java/cpw/mods/fml/client/config/IConfigElement.java +++ b/fml/src/main/java/cpw/mods/fml/client/config/IConfigElement.java @@ -34,7 +34,8 @@ public interface IConfigElement * This method returns a class that implements {@code IConfigEntry} or null. This class MUST * provide a constructor with the following parameter types: {@code GuiConfig}, {@code GuiConfigEntries}, {@code IConfigElement} */ - public Class getConfigEntryClass(); + @SuppressWarnings("rawtypes") + public Class getConfigEntryClass(); /** * This method returns a class that implements {@code IArrayEntry}. This class MUST provide a constructor with the @@ -67,7 +68,8 @@ public interface IConfigElement /** * [Category] Gets this category's child categories/properties. */ - public List getChildElements(); + @SuppressWarnings("rawtypes") + public List getChildElements(); /** * [Property, Category] Gets the ConfigGuiType value corresponding to the type of this property object, or CONFIG_CATEGORY if this is a diff --git a/fml/src/main/java/cpw/mods/fml/common/asm/transformers/AccessTransformer.java b/fml/src/main/java/cpw/mods/fml/common/asm/transformers/AccessTransformer.java index b68be46dfa..c428896c6f 100644 --- a/fml/src/main/java/cpw/mods/fml/common/asm/transformers/AccessTransformer.java +++ b/fml/src/main/java/cpw/mods/fml/common/asm/transformers/AccessTransformer.java @@ -27,14 +27,10 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; -import java.io.InputStream; import java.net.URL; import java.util.Collection; import java.util.Iterator; import java.util.List; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; @@ -55,7 +51,6 @@ import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; -import com.google.common.io.ByteSource; import com.google.common.io.CharSource; import com.google.common.io.LineProcessor; import com.google.common.io.Resources; diff --git a/fml/src/main/java/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.java b/fml/src/main/java/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.java index 9a72d3e740..c9a88965c1 100644 --- a/fml/src/main/java/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.java +++ b/fml/src/main/java/cpw/mods/fml/common/asm/transformers/ModAccessTransformer.java @@ -15,7 +15,8 @@ import cpw.mods.fml.relauncher.FMLRelaunchLog; public class ModAccessTransformer extends AccessTransformer { private static Map embedded = Maps.newHashMap(); //Needs to be primitive so that both classloaders get the same class. - public ModAccessTransformer() throws Exception + @SuppressWarnings("unchecked") + public ModAccessTransformer() throws Exception { super(ModAccessTransformer.class); //We are in the new ClassLoader here, so we need to get the static field from the other ClassLoader. diff --git a/fml/src/main/java/cpw/mods/fml/common/launcher/Yggdrasil.java b/fml/src/main/java/cpw/mods/fml/common/launcher/Yggdrasil.java index dc42c143f4..f9ee7dc44f 100644 --- a/fml/src/main/java/cpw/mods/fml/common/launcher/Yggdrasil.java +++ b/fml/src/main/java/cpw/mods/fml/common/launcher/Yggdrasil.java @@ -1,26 +1,15 @@ package cpw.mods.fml.common.launcher; -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; import java.net.Proxy; -import java.net.URL; -import java.util.List; import java.util.Map; -import org.apache.commons.io.IOUtils; import org.apache.logging.log4j.LogManager; -import com.google.common.base.Charsets; import com.google.common.base.Throwables; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.mojang.authlib.Agent; -import com.mojang.authlib.exceptions.*; -import com.mojang.authlib.yggdrasil.*; +import com.mojang.authlib.exceptions.AuthenticationException; +import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; +import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication; /** * Basic implementation of Mojang's 'Yggdrasil' login system, purely intended as a dev time bare bones login.