diff options
Diffstat (limited to 'dice-lang/src/main/java/bjc/dicelang/ast/nodes/LiteralDiceNode.java')
| -rw-r--r-- | dice-lang/src/main/java/bjc/dicelang/ast/nodes/LiteralDiceNode.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/LiteralDiceNode.java b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/LiteralDiceNode.java index e689c7f..1a6d2bf 100644 --- a/dice-lang/src/main/java/bjc/dicelang/ast/nodes/LiteralDiceNode.java +++ b/dice-lang/src/main/java/bjc/dicelang/ast/nodes/LiteralDiceNode.java @@ -38,7 +38,9 @@ public class LiteralDiceNode implements IDiceASTNode { /** * Create a new node with the given value - * @param val The value for this node + * + * @param val + * The value for this node */ public LiteralDiceNode(int val) { this(Integer.toString(val)); @@ -126,8 +128,12 @@ public class LiteralDiceNode implements IDiceASTNode { try { return new ScalarDie(Integer.parseInt(literalData)); } catch (NumberFormatException nfex) { - throw new UnsupportedOperationException( + UnsupportedOperationException usex = new UnsupportedOperationException( "Found malformed leaf token " + this); + + usex.initCause(nfex); + + throw usex; } } } @@ -165,7 +171,8 @@ public class LiteralDiceNode implements IDiceASTNode { try { Integer.parseInt(value); return true; - } catch (NumberFormatException nfex) { + } catch (@SuppressWarnings("unused") NumberFormatException nfex) { + // We don't care about details return false; } } |
