We're updating the issue view to help you get more done. 

DecimalFormat.parse() doesn't parse ""+Long.MAX_VALUE to Long

Description

Parsing a string representation of Long.MAX_VALUE should return a Long object, but returns a Double since ICU 59.

This JUnit test passes on ICU 58 and fails with 59:

1 2 3 4 5 6 7 8 @Test public void test_DecimalFormat_parse_Long_MAX_VALUE() throws ParseException { NumberFormat format = NumberFormat.getInstance(Locale.US); Number number = format.parse("9223372036854775807"); // parse() is documented to return a Long when the input is "within the range // [Long.MIN_VALUE, Long.MAX_VALUE] and with no decimals" assertEquals(Long.valueOf(9223372036854775807L), number); }

Environment

Status

Assignee

Shane Carr

Reporter

TracBot

tracCc

roubert,shane

tracCreated

Jun 07, 2017, 4:26 PM

tracOwner

shane

tracProject

ICU4J

tracReporter

Joachim Sauer <jsauer@45913043a294ac57

tracResolution

fixed

tracReviewer

andy

tracStatus

closed

Components

Fix versions

Priority

major