Skip to content

Commit

Permalink
Merge pull request #699 from SCADA-LTS/feature/#698_Fix_binary_value_…
Browse files Browse the repository at this point in the history
…parsing

#698  Temporary fixed binary value parsing
  • Loading branch information
ArkadiuszParafiniuk authored Sep 10, 2018
2 parents 148f0c7 + 4de903e commit 1bd82d3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/com/serotonin/mango/rt/dataImage/types/BinaryValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public class BinaryValue extends MangoValue implements Comparable<BinaryValue> {
public static final BinaryValue ONE = new BinaryValue(true);

public static BinaryValue parseBinary(String s) {
if(s==null) return ZERO;
s = s.trim().toLowerCase();
if(s == null || s.equals("0") || s.equals("false")) {
return ZERO;
} else if(s.equals("1") || s.equals("true")) {
if(s.equals("1") || s.equals("true")) {
return ONE;
} else {
return ZERO;
}
throw new NumberFormatException("Value is not a binary.");
}

private final boolean value;
Expand Down

0 comments on commit 1bd82d3

Please sign in to comment.