Cleanup: removed IEEP, removed redundant casts, fixed imports, fixed typos.

This commit is contained in:
RainWarrior committed 2016-03-24 22:22:20 +03:00
1 parent 7e4d7077a5
commit a9d23f5e78
133 files changed
+489 -623

No files matched your search

@@ -23,12 +23,12 @@ public class ConfigElement implements IConfigElement
private Property prop;
private Property.Type type;
private boolean isProperty;
private ConfigCategory ctgy;
private ConfigCategory category;
private boolean categoriesFirst = true;
public ConfigElement(ConfigCategory ctgy)
public ConfigElement(ConfigCategory category)
{
this.ctgy = ctgy;
this.category = category;
isProperty = false;
}
@@ -51,8 +51,8 @@ public class ConfigElement implements IConfigElement
if (!isProperty)
{
List<IConfigElement> elements = new ArrayList<IConfigElement>();
Iterator<ConfigCategory> ccI = ctgy.getChildren().iterator();
Iterator<Property> pI = ctgy.getOrderedValues().iterator();
Iterator<ConfigCategory> ccI = category.getChildren().iterator();
Iterator<Property> pI = category.getOrderedValues().iterator();
@SuppressWarnings("unused")
int index = 0;
@@ -87,7 +87,7 @@ public class ConfigElement implements IConfigElement
@Override
public String getName()
{
return isProperty ? prop.getName() : ctgy.getName();
return isProperty ? prop.getName() : category.getName();
}
@Override
@@ -99,7 +99,7 @@ public class ConfigElement implements IConfigElement
@Override
public Class<? extends IConfigEntry> getConfigEntryClass()
{
return isProperty ? prop.getConfigEntryClass() : ctgy.getConfigEntryClass();
return isProperty ? prop.getConfigEntryClass() : category.getConfigEntryClass();
}
@Override
@@ -111,7 +111,7 @@ public class ConfigElement implements IConfigElement
@Override
public String getQualifiedName()
{
return isProperty ? prop.getName() : ctgy.getQualifiedName();
return isProperty ? prop.getName() : category.getQualifiedName();
}
@Override
@@ -148,7 +148,7 @@ public class ConfigElement implements IConfigElement
@Override
public String getComment()
{
return isProperty ? prop.comment : ctgy.getComment();
return isProperty ? prop.comment : category.getComment();
}
@Override
@@ -167,19 +167,19 @@ public class ConfigElement implements IConfigElement
@Override
public boolean requiresWorldRestart()
{
return isProperty ? prop.requiresWorldRestart() : ctgy.requiresWorldRestart();
return isProperty ? prop.requiresWorldRestart() : category.requiresWorldRestart();
}
@Override
public boolean showInGui()
{
return isProperty ? prop.showInGui() : ctgy.showInGui();
return isProperty ? prop.showInGui() : category.showInGui();
}
@Override
public boolean requiresMcRestart()
{
return isProperty ? prop.requiresMcRestart() : ctgy.requiresMcRestart();
return isProperty ? prop.requiresMcRestart() : category.requiresMcRestart();
}
@Override
@@ -191,7 +191,7 @@ public class ConfigElement implements IConfigElement
@Override
public String getLanguageKey()
{
return isProperty ? prop.getLanguageKey() : ctgy.getLanguagekey();
return isProperty ? prop.getLanguageKey() : category.getLanguagekey();
}
@Override
@@ -166,7 +166,7 @@ public class Configuration
*/
public Property get(String category, String key, boolean defaultValue)
{
return get(category, key, defaultValue, (String) null);
return get(category, key, defaultValue, null);
}
/**
@@ -201,7 +201,7 @@ public class Configuration
*/
public Property get(String category, String key, boolean[] defaultValues)
{
return get(category, key, defaultValues, (String) null);
return get(category, key, defaultValues, null);
}
/**
@@ -268,7 +268,7 @@ public class Configuration
*/
public Property get(String category, String key, int defaultValue)
{
return get(category, key, defaultValue, (String) null, Integer.MIN_VALUE, Integer.MAX_VALUE);
return get(category, key, defaultValue, null, Integer.MIN_VALUE, Integer.MAX_VALUE);
}
/**
@@ -321,7 +321,7 @@ public class Configuration
*/
public Property get(String category, String key, int[] defaultValues)
{
return get(category, key, defaultValues, (String) null);
return get(category, key, defaultValues, null);
}
/**
@@ -410,7 +410,7 @@ public class Configuration
*/
public Property get(String category, String key, double defaultValue)
{
return get(category, key, defaultValue, (String) null);
return get(category, key, defaultValue, null);
}
/**
@@ -553,7 +553,7 @@ public class Configuration
*/
public Property get(String category, String key, String defaultValue)
{
return get(category, key, defaultValue, (String) null);
return get(category, key, defaultValue, null);
}
/**
@@ -615,7 +615,7 @@ public class Configuration
*/
public Property get(String category, String key, String[] defaultValues)
{
return get(category, key, defaultValues, (String) null, false, -1, (Pattern) null);
return get(category, key, defaultValues, null, false, -1, null);
}
/**
@@ -629,7 +629,7 @@ public class Configuration
*/
public Property get(String category, String key, String[] defaultValues, String comment)
{
return get(category, key, defaultValues, comment, false, -1, (Pattern) null);
return get(category, key, defaultValues, comment, false, -1, null);
}
/**
@@ -877,7 +877,7 @@ public class Configuration
}
else if (Character.isWhitespace(line.charAt(i)))
{
// ignore space charaters
// ignore space characters
}
else
{
@@ -927,7 +927,7 @@ public class Configuration
break;
if (currentCat == null)
{
throw new RuntimeException(String.format("Config file corrupt, attepted to close to many categories '%s:%d'", fileName, lineNum));
throw new RuntimeException(String.format("Config file corrupt, attempted to close to many categories '%s:%d'", fileName, lineNum));
}
currentCat = currentCat.parent;
break;
@@ -1330,7 +1330,7 @@ public class Configuration
size = 4;
}
else if (bom32 == 0xFFFE0000) //This will never happen as it'll be caught by UTF-16LE,
{ //but if anyone ever runs across a 32LE file, i'd like to disect it.
{ //but if anyone ever runs across a 32LE file, i'd like to dissect it.
enc = "UTF-32LE";
size = 4;
}
@@ -1567,7 +1567,7 @@ public class Configuration
*/
public String[] getStringList(String name, String category, String[] defaultValues, String comment)
{
return getStringList(name, category, defaultValues, comment, (String[]) null, name);
return getStringList(name, category, defaultValues, comment, null, name);
}
/**