From 7ad97cc7a8d529f2c11be63b4a14ec4fb2ca5198 Mon Sep 17 00:00:00 2001 From: Alexander Verbraeck Date: Sun, 17 Sep 2023 21:47:32 +0200 Subject: [PATCH] Instantiation of scalars done with instantiateAnonymous method. The non-anonymous version gave problems with compilation in java 11. --- djutils-eval/src/main/java/org/djutils/eval/Eval.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/djutils-eval/src/main/java/org/djutils/eval/Eval.java b/djutils-eval/src/main/java/org/djutils/eval/Eval.java index 7f4f89e8..fc808901 100644 --- a/djutils-eval/src/main/java/org/djutils/eval/Eval.java +++ b/djutils-eval/src/main/java/org/djutils/eval/Eval.java @@ -918,7 +918,7 @@ private void add() { // Rel + Rel -> Rel DoubleScalar sum = - DoubleScalarRel.instantiate(((DoubleScalarRel) left).si + ((DoubleScalarRel) right).si, + DoubleScalarRel.instantiateAnonymous(((DoubleScalarRel) left).si + ((DoubleScalarRel) right).si, ((DoubleScalarRel) left).getDisplayUnit().getStandardUnit()); // System.out.println(left + " + " + right + " = " + sum); // Set display unit??? @@ -931,7 +931,7 @@ private void add() } // Abs + Rel -> Abs DoubleScalar sum = - DoubleScalarAbs.instantiate(((DoubleScalarAbs) left).si + ((DoubleScalarRel) right).si, + DoubleScalarAbs.instantiateAnonymous(((DoubleScalarAbs) left).si + ((DoubleScalarRel) right).si, ((DoubleScalarAbs) left).getDisplayUnit().getStandardUnit()); // System.out.println(left + " + " + right + " = " + sum); // sum.setDisplayUnit(ds.getDisplayUnit()); @@ -962,7 +962,7 @@ private void subtract() { // Abs - Abs -> Rel DoubleScalar difference = - DoubleScalarRel.instantiate(((DoubleScalar) left).si - ((DoubleScalar) right).si, + DoubleScalarRel.instantiateAnonymous(((DoubleScalar) left).si - ((DoubleScalar) right).si, ((DoubleScalar) left).getDisplayUnit().getStandardUnit()); // System.out.println(left + " - " + right + " = " + difference); push(difference); @@ -972,7 +972,7 @@ private void subtract() { // Abs - Rel -> Abs DoubleScalar difference = - DoubleScalarAbs.instantiate(((DoubleScalar) left).si - ((DoubleScalar) right).si, + DoubleScalarAbs.instantiateAnonymous(((DoubleScalar) left).si - ((DoubleScalar) right).si, ((DoubleScalar) left).getDisplayUnit().getStandardUnit()); // System.out.println(left + " - " + right + " = " + difference); push(difference); @@ -985,7 +985,7 @@ private void subtract() } // Rel - Rel -> Rel DoubleScalar difference = - DoubleScalarRel.instantiate(((DoubleScalar) left).si - ((DoubleScalar) right).si, + DoubleScalarRel.instantiateAnonymous(((DoubleScalar) left).si - ((DoubleScalar) right).si, ((DoubleScalar) left).getDisplayUnit().getStandardUnit()); // System.out.println(left + " - " + right + " = " + difference); push(difference);