8364025: MinMaxVector clipping range benchmark highestInt/Long can overflow

Reviewed-by: roland, kxu
This commit is contained in:
Galder Zamarreño 2026-07-24 20:31:59 +00:00
parent bb2cdfe569
commit 67afba7cbe

View File

@ -185,11 +185,11 @@ public class MinMaxVector
}
final IntSummaryStatistics intStats = Arrays.stream(ints).summaryStatistics();
highestInt = (intStats.getMax() * range) / 100;
highestInt = (int) (intStats.getMax() * (range / 100f));
lowestInt = intStats.getMin() + (intStats.getMax() - highestInt);
final LongSummaryStatistics longStats = Arrays.stream(longs).summaryStatistics();
highestLong = (longStats.getMax() * range) / 100;
highestLong = (long) (longStats.getMax() * (range / 100f));
lowestLong = longStats.getMin() + (longStats.getMax() - highestLong);
}
}