This commit is contained in:
Jesse Boyd 2016-09-14 10:21:14 +10:00
parent 63259ec269
commit 56227a6d7d

View File

@ -162,10 +162,15 @@ public final class Flags {
Object remove; Object remove;
if (value.DEFAULT_FLAGS.containsKey(duplicate)) { if (value.DEFAULT_FLAGS.containsKey(duplicate)) {
remove = value.DEFAULT_FLAGS.remove(duplicate); remove = value.DEFAULT_FLAGS.remove(duplicate);
if (remove instanceof Collection) try {
value.DEFAULT_FLAGS.put(flag, flag.parseValue(StringMan.join((Collection) remove, ','))); if (remove instanceof Collection && remove.getClass().getMethod("toString").getDeclaringClass() == Object.class) {
else value.DEFAULT_FLAGS.put(flag, flag.parseValue(StringMan.join((Collection) remove, ',')));
value.DEFAULT_FLAGS.put(flag,flag.parseValue("" + remove)); } else {
value.DEFAULT_FLAGS.put(flag, flag.parseValue("" + remove));
}
} catch (NoSuchMethodException neverHappens) {
neverHappens.printStackTrace();
}
} }
} }
}); });
@ -173,10 +178,15 @@ public final class Flags {
@Override public void run(Plot value) { @Override public void run(Plot value) {
if (value.getFlags().containsKey(duplicate)) { if (value.getFlags().containsKey(duplicate)) {
Object remove = value.getFlags().remove(duplicate); Object remove = value.getFlags().remove(duplicate);
if (remove instanceof Collection) try {
value.getFlags().put(flag, flag.parseValue(StringMan.join((Collection) remove, ','))); if (remove instanceof Collection && remove.getClass().getMethod("toString").getDeclaringClass() == Object.class) {
else value.getFlags().put(flag, flag.parseValue(StringMan.join((Collection) remove, ',')));
value.getFlags().put(flag,flag.parseValue("" + remove)); } else {
value.getFlags().put(flag, flag.parseValue("" + remove));
}
} catch (NoSuchMethodException neverHappens) {
neverHappens.printStackTrace();
}
} }
} }
}); });