Added missing final modifiers.
This commit is contained in:
@@ -40,13 +40,13 @@ public class DateRange
|
||||
|
||||
public static DateRange parse(String dateRange, DateFormat format)
|
||||
{
|
||||
String[] date = dateRange.split("-");
|
||||
final String[] date = dateRange.split("-");
|
||||
if (date.length == 2)
|
||||
{
|
||||
try
|
||||
{
|
||||
Date start = format.parse(date[0]);
|
||||
Date end = format.parse(date[1]);
|
||||
final Date start = format.parse(date[0]);
|
||||
final Date end = format.parse(date[1]);
|
||||
|
||||
return new DateRange(start, end);
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ public class IntList
|
||||
return getIntegerList(range.split(","));
|
||||
}
|
||||
|
||||
int[] list =
|
||||
final int[] list =
|
||||
{
|
||||
getInt(range)
|
||||
};
|
||||
@@ -48,7 +48,7 @@ public class IntList
|
||||
|
||||
private static int[] getIntegerList(String[] numbers)
|
||||
{
|
||||
int[] list = new int[numbers.length];
|
||||
final int[] list = new int[numbers.length];
|
||||
for (int i = 0; i < list.length; i++)
|
||||
{
|
||||
list[i] = getInt(numbers[i]);
|
||||
@@ -58,9 +58,9 @@ public class IntList
|
||||
|
||||
private static int[] getIntegerRange(String[] numbers)
|
||||
{
|
||||
int min = getInt(numbers[0]);
|
||||
int max = getInt(numbers[1]);
|
||||
int[] list = new int[(max - min) + 1];
|
||||
final int min = getInt(numbers[0]);
|
||||
final int max = getInt(numbers[1]);
|
||||
final int[] list = new int[(max - min) + 1];
|
||||
for (int i = 0; i < list.length; i++)
|
||||
{
|
||||
list[i] = min + i;
|
||||
|
@@ -44,10 +44,10 @@ public class ScriptDocument
|
||||
{
|
||||
_name = name;
|
||||
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
try
|
||||
{
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
final DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
_document = builder.parse(input);
|
||||
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ public class ScriptPackage
|
||||
{
|
||||
for (Enumeration<? extends ZipEntry> e = pack.entries(); e.hasMoreElements();)
|
||||
{
|
||||
ZipEntry entry = e.nextElement();
|
||||
final ZipEntry entry = e.nextElement();
|
||||
if (entry.getName().endsWith(".xml"))
|
||||
{
|
||||
try
|
||||
@@ -103,7 +103,7 @@ public class ScriptPackage
|
||||
return "Empty Package.";
|
||||
}
|
||||
|
||||
StringBuilder out = new StringBuilder();
|
||||
final StringBuilder out = new StringBuilder();
|
||||
out.append("Package Name: ");
|
||||
out.append(getName());
|
||||
out.append(Config.EOL);
|
||||
|
@@ -34,7 +34,7 @@ public class ShortList
|
||||
return getShortList(range.split(","));
|
||||
}
|
||||
|
||||
short[] list =
|
||||
final short[] list =
|
||||
{
|
||||
getShort(range)
|
||||
};
|
||||
@@ -48,7 +48,7 @@ public class ShortList
|
||||
|
||||
private static short[] getShortList(String[] numbers)
|
||||
{
|
||||
short[] list = new short[numbers.length];
|
||||
final short[] list = new short[numbers.length];
|
||||
for (int i = 0; i < list.length; i++)
|
||||
{
|
||||
list[i] = getShort(numbers[i]);
|
||||
|
@@ -44,10 +44,10 @@ public class FaenorEventParser extends FaenorParser
|
||||
@Override
|
||||
public void parseScript(final Node eventNode, ScriptContext context)
|
||||
{
|
||||
String ID = attribute(eventNode, "ID");
|
||||
final String ID = attribute(eventNode, "ID");
|
||||
_eventDates = DateRange.parse(attribute(eventNode, "Active"), DATE_FORMAT);
|
||||
|
||||
Date currentDate = new Date();
|
||||
final Date currentDate = new Date();
|
||||
if (_eventDates.getEndDate().before(currentDate))
|
||||
{
|
||||
_log.info("Event ID: (" + ID + ") has passed... Ignored.");
|
||||
@@ -83,8 +83,8 @@ public class FaenorEventParser extends FaenorParser
|
||||
{
|
||||
try
|
||||
{
|
||||
String type = attribute(sysMsg, "Type");
|
||||
String message = attribute(sysMsg, "Msg");
|
||||
final String type = attribute(sysMsg, "Type");
|
||||
final String message = attribute(sysMsg, "Msg");
|
||||
|
||||
if (type.equalsIgnoreCase("OnJoin"))
|
||||
{
|
||||
@@ -112,9 +112,9 @@ public class FaenorEventParser extends FaenorParser
|
||||
{
|
||||
try
|
||||
{
|
||||
int[] items = IntList.parse(attribute(drop, "Items"));
|
||||
int[] count = IntList.parse(attribute(drop, "Count"));
|
||||
double chance = getPercent(attribute(drop, "Chance"));
|
||||
final int[] items = IntList.parse(attribute(drop, "Items"));
|
||||
final int[] count = IntList.parse(attribute(drop, "Count"));
|
||||
final double chance = getPercent(attribute(drop, "Chance"));
|
||||
|
||||
_bridge.addEventDrop(items, count, chance, _eventDates);
|
||||
}
|
||||
|
@@ -72,10 +72,10 @@ public abstract class FaenorParser extends Parser
|
||||
{
|
||||
try
|
||||
{
|
||||
NodeList list = parentNode.getChildNodes();
|
||||
final NodeList list = parentNode.getChildNodes();
|
||||
for (int i = 0; i < list.getLength(); i++)
|
||||
{
|
||||
Node node = list.item(i);
|
||||
final Node node = list.item(i);
|
||||
if (node.getNodeName().equalsIgnoreCase(elementName))
|
||||
{
|
||||
return node.getTextContent();
|
||||
|
@@ -66,8 +66,8 @@ public class FaenorScriptEngine extends ScriptEngine
|
||||
|
||||
public void parseScript(ScriptDocument script, ScriptContext context)
|
||||
{
|
||||
Node node = script.getDocument().getFirstChild();
|
||||
String parserClass = "faenor.Faenor" + node.getNodeName() + "Parser";
|
||||
final Node node = script.getDocument().getFirstChild();
|
||||
final String parserClass = "faenor.Faenor" + node.getNodeName() + "Parser";
|
||||
|
||||
Parser parser = null;
|
||||
try
|
||||
|
Reference in New Issue
Block a user