Resolve compatibility issues with JRE 7.

Change settings file name.
This commit is contained in:
StevenLawson 2014-08-29 16:08:22 -04:00
parent 051a53ab21
commit 7c148988f9
7 changed files with 53 additions and 7 deletions

2
.gitignore vendored
View file

@ -1,2 +1,2 @@
/target/
settings.xml
/btc_settings.xml

View file

@ -32,7 +32,7 @@ import org.xml.sax.SAXException;
public class BTC_ConfigLoader
{
private static final String SETTINGS_FILE = "settings.xml";
private static final String SETTINGS_FILE = "btc_settings.xml";
private final ServerEntry.ServerEntryList servers = new ServerEntry.ServerEntryList();
private final PlayerCommandEntry.PlayerCommandEntryList playerCommands = new PlayerCommandEntry.PlayerCommandEntryList();
@ -44,7 +44,7 @@ public class BTC_ConfigLoader
public boolean load(boolean verbose)
{
File settings = new File("settings.xml");
File settings = new File(SETTINGS_FILE);
if (!settings.exists())
{

View file

@ -112,6 +112,12 @@ public class BTC_PlayerListDecoder
{
return array.getJSONObject(index++);
}
@Override
public void remove()
{
throw new UnsupportedOperationException();
}
};
}
}

View file

@ -18,6 +18,8 @@
*/
package me.StevenLawson.BukkitTelnetClient;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.UnsupportedLookAndFeelException;

View file

@ -18,6 +18,7 @@
*/
package me.StevenLawson.BukkitTelnetClient;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Level;
@ -49,7 +50,15 @@ public abstract class ConfigEntry
final Element itemElement = (Element) itemNode;
for (final Method method : getClass().getDeclaredMethods())
{
final ParameterSetter annotation = method.getDeclaredAnnotation(ParameterSetter.class);
ParameterSetter annotation = null;
for (Annotation _annotation : method.getDeclaredAnnotations())
{
if (_annotation instanceof ParameterSetter)
{
annotation = (ParameterSetter) _annotation;
break;
}
}
if (annotation == null)
{
continue;
@ -90,7 +99,15 @@ public abstract class ConfigEntry
for (final Method method : getClass().getDeclaredMethods())
{
final ParameterGetter annotation = method.getDeclaredAnnotation(ParameterGetter.class);
ParameterGetter annotation = null;
for (Annotation _annotation : method.getDeclaredAnnotations())
{
if (_annotation instanceof ParameterGetter)
{
annotation = (ParameterGetter) _annotation;
break;
}
}
if (annotation == null)
{
continue;

View file

@ -18,6 +18,7 @@
*/
package me.StevenLawson.BukkitTelnetClient;
import java.lang.annotation.Annotation;
import java.lang.reflect.*;
import java.util.*;
import java.util.logging.Level;
@ -55,7 +56,15 @@ public abstract class ConfigEntryList<E extends ConfigEntry>
for (final Method method : getEntryClass().getDeclaredMethods())
{
final ParameterGetter annotation = method.getDeclaredAnnotation(ParameterGetter.class);
ParameterGetter annotation = null;
for (Annotation _annotation : method.getDeclaredAnnotations())
{
if (_annotation instanceof ParameterGetter)
{
annotation = (ParameterGetter) _annotation;
break;
}
}
if (annotation == null)
{
continue;
@ -114,7 +123,15 @@ public abstract class ConfigEntryList<E extends ConfigEntry>
final Element itemElement = (Element) itemNode;
for (final Method method : getEntryClass().getDeclaredMethods())
{
final ParameterSetter annotation = method.getDeclaredAnnotation(ParameterSetter.class);
ParameterSetter annotation = null;
for (Annotation _annotation : method.getDeclaredAnnotations())
{
if (_annotation instanceof ParameterSetter)
{
annotation = (ParameterSetter) _annotation;
break;
}
}
if (annotation == null)
{
continue;

View file

@ -74,6 +74,10 @@
<name>Seen IP</name>
<format>seen $TARGET_IP</format>
</playerCommand>
<playerCommand>
<name>Clear Nickname</name>
<format>nick $TARGET_NAME off</format>
</playerCommand>
</playerCommands>
<favoriteButtons>
<favoriteButton>