From db3fe10b6738c7441fc58788111635437b732b27 Mon Sep 17 00:00:00 2001 From: holly-smile <166412459+holly-smile@users.noreply.github.com> Date: Thu, 11 Jul 2024 11:35:12 -0700 Subject: [PATCH] Run spotless (#1382) --- .../elm/executing/PopulationStdDevEvaluator.java | 2 +- .../cql/engine/elm/executing/StdDevEvaluator.java | 2 +- .../org/opencds/cqf/cql/engine/runtime/Value.java | 1 + .../engine/execution/CqlAggregateFunctionsTest.java | 3 --- .../execution/CqlValueLiteralsAndSelectorsTest.java | 12 +++--------- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/elm/executing/PopulationStdDevEvaluator.java b/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/elm/executing/PopulationStdDevEvaluator.java index ff4d9b0e1..3c8384b22 100644 --- a/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/elm/executing/PopulationStdDevEvaluator.java +++ b/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/elm/executing/PopulationStdDevEvaluator.java @@ -32,7 +32,7 @@ public static Object popStdDev(Object source, State state) { Object variance = PopulationVarianceEvaluator.popVariance(source, state); // The cases in which PopulationVariance returns null are the same as those where PopulationStdDev does. - if(variance == null) { + if (variance == null) { return null; } diff --git a/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/elm/executing/StdDevEvaluator.java b/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/elm/executing/StdDevEvaluator.java index cc9e27caa..94624d965 100644 --- a/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/elm/executing/StdDevEvaluator.java +++ b/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/elm/executing/StdDevEvaluator.java @@ -32,7 +32,7 @@ public static Object stdDev(Object source, State state) { Object variance = VarianceEvaluator.variance(source, state); // The cases in which Variance returns null are the same as those where StdDev does. - if(variance == null) { + if (variance == null) { return null; } diff --git a/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/runtime/Value.java b/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/runtime/Value.java index 0aea39e9c..c42614eaf 100644 --- a/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/runtime/Value.java +++ b/Src/java/engine/src/main/java/org/opencds/cqf/cql/engine/runtime/Value.java @@ -14,6 +14,7 @@ public class Value { * Set to (1028 - 1) / 108. */ public static final BigDecimal MAX_DECIMAL = new BigDecimal("99999999999999999999.99999999"); + public static final Integer MIN_INT = Integer.MIN_VALUE; public static final Long MIN_LONG = Long.MIN_VALUE; diff --git a/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlAggregateFunctionsTest.java b/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlAggregateFunctionsTest.java index 769e23470..233a60b32 100644 --- a/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlAggregateFunctionsTest.java +++ b/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlAggregateFunctionsTest.java @@ -7,8 +7,6 @@ import java.math.BigDecimal; import java.util.Arrays; - -import org.hamcrest.core.IsNull; import org.junit.jupiter.api.Test; import org.opencds.cqf.cql.engine.elm.executing.AnyTrueEvaluator; import org.opencds.cqf.cql.engine.elm.executing.AvgEvaluator; @@ -79,7 +77,6 @@ void all_aggregate_function_tests() { value = results.forExpression("AnyTrueIsFalseWhenNull").value(); assertThat(value, is(false)); - try { value = AnyTrueEvaluator.anyTrue(Arrays.asList("this", "is", "error")); fail(); diff --git a/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlValueLiteralsAndSelectorsTest.java b/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlValueLiteralsAndSelectorsTest.java index e159c0a3d..0f668559b 100644 --- a/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlValueLiteralsAndSelectorsTest.java +++ b/Src/java/engine/src/test/java/org/opencds/cqf/cql/engine/execution/CqlValueLiteralsAndSelectorsTest.java @@ -155,25 +155,19 @@ void all_value_literals_and_selectors() { // define QuantityMax: 99999999999999999999.99999999 'mg' value = results.forExpression("QuantityMax").value(); assertThat(value, instanceOf(Quantity.class)); - assertThat( - ((Quantity) value).getValue(), - comparesEqualTo(new BigDecimal("99999999999999999999.99999999"))); + assertThat(((Quantity) value).getValue(), comparesEqualTo(new BigDecimal("99999999999999999999.99999999"))); assertThat(((Quantity) value).getUnit(), is("mg")); // define QuantityPosMax: +99999999999999999999.99999999 'mg' value = results.forExpression("QuantityPosMax").value(); assertThat(value, instanceOf(Quantity.class)); - assertThat( - ((Quantity) value).getValue(), - comparesEqualTo(new BigDecimal("99999999999999999999.99999999"))); + assertThat(((Quantity) value).getValue(), comparesEqualTo(new BigDecimal("99999999999999999999.99999999"))); assertThat(((Quantity) value).getUnit(), is("mg")); // define QuantityMin: -99999999999999999999.99999999 'mg' value = results.forExpression("QuantityMin").value(); assertThat(value, instanceOf(Quantity.class)); - assertThat( - ((Quantity) value).getValue(), - comparesEqualTo(new BigDecimal("-99999999999999999999.99999999"))); + assertThat(((Quantity) value).getValue(), comparesEqualTo(new BigDecimal("-99999999999999999999.99999999"))); assertThat(((Quantity) value).getUnit(), is("mg")); value = results.forExpression("DecimalZero").value();