Details
-
Bug
-
Resolution: Fixed
-
P2
-
8
-
b94
-
Verified
Description
IllegalFormatConversionException with following message:
"d != java.lang.Double"
is thrown when you try to call toString() applied to empty(or not) result container for following collectors:
Please see example below:
import java.util.function.ToIntFunction;
import java.util.stream.Collectors;
public class Main {
private static final ToIntFunction<Object> toIntFunction = (Object obj) -> 1;
public static void main(String[] args) {
Collectors.toIntSummaryStatistics(toIntFunction).resultSupplier().get().toString();
}
}
The same happens in the case of Collectors.toLongSummaryStatistics
The following testcases will fail due to this issue:
api/java_util/stream/Collectors/ToIntSummaryStatistics.html\#ToIntSummaryStatistics[accumulator_Test, combinerTest1_Args]
api/java_util/stream/Collectors/ToLongSummaryStatistics.html\#ToLongSummaryStatistics[accumulator_Test, combinerTest1_Args]
"d != java.lang.Double"
is thrown when you try to call toString() applied to empty(or not) result container for following collectors:
Please see example below:
import java.util.function.ToIntFunction;
import java.util.stream.Collectors;
public class Main {
private static final ToIntFunction<Object> toIntFunction = (Object obj) -> 1;
public static void main(String[] args) {
Collectors.toIntSummaryStatistics(toIntFunction).resultSupplier().get().toString();
}
}
The same happens in the case of Collectors.toLongSummaryStatistics
The following testcases will fail due to this issue:
api/java_util/stream/Collectors/ToIntSummaryStatistics.html\#ToIntSummaryStatistics[accumulator_Test, combinerTest1_Args]
api/java_util/stream/Collectors/ToLongSummaryStatistics.html\#ToLongSummaryStatistics[accumulator_Test, combinerTest1_Args]
Attachments
Issue Links
- relates to
-
JDK-8012691 IntSummaryStatistics, LongSummaryStatistics: toString() fails with java.util.IllegalFormatConversionException
- Resolved