Skip to content

Commit

Permalink
8292877: java/util/concurrent/atomic/Serial.java uses {Double,Long}Ac…
Browse files Browse the repository at this point in the history
…cumulator incorrectly

Backport-of: 251bff6beeafcd98824dab60e9831c0175fe0689
  • Loading branch information
GoeLin committed Feb 28, 2023
1 parent 6ed8694 commit 558eab2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/jdk/java/util/concurrent/atomic/Serial.java
Expand Up @@ -64,8 +64,8 @@ static void testDoubleAdder() {
}

static void testDoubleAccumulator() {
DoubleBinaryOperator plus = (DoubleBinaryOperator & Serializable) (x, y) -> x + y;
DoubleAccumulator a = new DoubleAccumulator(plus, 13.9d);
DoubleBinaryOperator op = (DoubleBinaryOperator & Serializable) (x, y) -> Math.max(x, y);
DoubleAccumulator a = new DoubleAccumulator(op, Double.NEGATIVE_INFINITY);
a.accumulate(17.5d);
DoubleAccumulator result = echo(a);
if (result.get() != a.get())
Expand All @@ -89,8 +89,8 @@ static void testLongAdder() {
}

static void testLongAccumulator() {
LongBinaryOperator plus = (LongBinaryOperator & Serializable) (x, y) -> x + y;
LongAccumulator a = new LongAccumulator(plus, -2);
LongBinaryOperator op = (LongBinaryOperator & Serializable) (x, y) -> Math.max(x, y);
LongAccumulator a = new LongAccumulator(op, Long.MIN_VALUE);
a.accumulate(34);
LongAccumulator result = echo(a);
if (result.get() != a.get())
Expand Down

0 comments on commit 558eab2

Please sign in to comment.