Skip to content

Commit

Permalink
Instantiation of scalars done with instantiateAnonymous method.
Browse files Browse the repository at this point in the history
The non-anonymous version gave problems with compilation in java 11.
  • Loading branch information
averbraeck committed Sep 17, 2023
1 parent 8f139f9 commit 7ad97cc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions djutils-eval/src/main/java/org/djutils/eval/Eval.java
Original file line number Diff line number Diff line change
Expand Up @@ -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???
Expand All @@ -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());
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 7ad97cc

Please sign in to comment.