From fbdf2c7e52a2f37d69e4221047e1bc8c91ada4af Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 21 Sep 2017 23:09:13 -0700 Subject: [PATCH] Eliminate warnings related to null returns that have been removed. --- .../src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java | 4 ++-- core/src/main/kotlin/org/nwapw/abacus/tree/NumberReducer.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java b/core/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java index 3d20019..9d95303 100755 --- a/core/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java +++ b/core/src/main/java/org/nwapw/abacus/plugin/StandardPlugin.java @@ -332,7 +332,7 @@ public class StandardPlugin extends Plugin { //We'll use the series \sigma_{n >= 1) ((1/3^n + 1/4^n) * 1/n) //In the following, a=1/3^n, b=1/4^n, c = 1/n. //a is also an error bound. - NumberInterface a = implementation.instanceForString("1"), b = a, c = a; + NumberInterface a = implementation.instanceForString("1"), b = a, c; NumberInterface sum = implementation.instanceForString("0"); NumberInterface one = implementation.instanceForString("1"); int n = 0; @@ -715,7 +715,7 @@ public class StandardPlugin extends Plugin { * @return the value of the series */ private static NumberInterface sinTaylor(MutableEvaluationContext context, NumberInterface x) { - NumberInterface power = x, multiplier = x.multiply(x).negate(), currentTerm = x, sum = x; + NumberInterface power = x, multiplier = x.multiply(x).negate(), currentTerm, sum = x; NumberInterface maxError = x.getMaxError(); int n = 1; do { diff --git a/core/src/main/kotlin/org/nwapw/abacus/tree/NumberReducer.kt b/core/src/main/kotlin/org/nwapw/abacus/tree/NumberReducer.kt index 7eff50a..e03b77e 100644 --- a/core/src/main/kotlin/org/nwapw/abacus/tree/NumberReducer.kt +++ b/core/src/main/kotlin/org/nwapw/abacus/tree/NumberReducer.kt @@ -17,7 +17,7 @@ class NumberReducer(val abacus: Abacus, context: EvaluationContext) : Reducer { - context.inheritedNumberImplementation?.instanceForString(treeNode.number) + context.inheritedNumberImplementation.instanceForString(treeNode.number) ?: throw EvaluationException("no number implementation selected.") } is VariableNode -> {