Skip to content

Commit

Permalink
Remove deprecated NumberNode method use
Browse files Browse the repository at this point in the history
  • Loading branch information
kstich committed Sep 6, 2023
1 parent 40358a9 commit 489cd28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Value nullNode(NullNode node) {
@Override
public Value numberNode(NumberNode node) {
int nodeValue = node.getValue().intValue();
if (!node.isNaturalNumber() || nodeValue < 0) {
if (node.isFloatingPointNumber() || nodeValue < 0) {
throw new RuntimeException("only integers >=0 are supported");
}
return Value.integerValue(nodeValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public final class IntegerLiteral extends Literal {

private void validateValue(NumberNode node) {
int nodeValue = node.getValue().intValue();
if (!node.isNaturalNumber() || nodeValue < 0) {
if (node.isFloatingPointNumber() || nodeValue < 0) {
throw new RuntimeException("Only integer values greater than or equal to 0 are supported.");
}
}
Expand Down

0 comments on commit 489cd28

Please sign in to comment.