Skip to content

Commit

Permalink
Don't misread empty strings, don't output pointlessly
Browse files Browse the repository at this point in the history
arg is not a double if it's empty
that output is unneeded half the time... it should be an echoDebug at
best.
  • Loading branch information
mcmonkey4eva committed Oct 11, 2014
1 parent d88a8db commit 16329f0
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -77,13 +77,13 @@ public void setOperator(Operator operator) {
public void setComparable(String arg) {

// If a Number
if (aH.matchesInteger(arg))
if (arg.length() > 0 && aH.matchesInteger(arg))
comparable = aH.getLongFrom(arg);
else if (aH.matchesDouble(arg))
else if (arg.length() > 0 && aH.matchesDouble(arg))
comparable = aH.getDoubleFrom(arg);

// If a List<Object>
else if (dList.matches(arg)) {
else if (arg.length() > 0 && dList.matches(arg)) {
comparable = dList.valueOf(arg);
}

Expand Down Expand Up @@ -111,8 +111,9 @@ else if (aH.matchesDouble(arg))
comparedto = aH.getDoubleFrom(arg);
else {
if (!arg.equalsIgnoreCase("null"))
dB.log(ChatColor.YELLOW + "WARNING! " + ChatColor.WHITE + "Cannot compare NUMBER("
+ comparable + ") with '" + arg + "'. Outcome for this Comparable will be false.");
// TODO: echoDebug instead of log
// dB.log(ChatColor.YELLOW + "WARNING! " + ChatColor.WHITE + "Cannot compare NUMBER("
// + comparable + ") with '" + arg + "'. Outcome for this Comparable will be false.");
comparedto = Double.NaN;
}
}
Expand Down

0 comments on commit 16329f0

Please sign in to comment.