Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why am I java.lang.NumberFormatException: multiple points on parsing a long

paultaylorOct 28 2008 — edited Feb 9 2010
I try read and number into a date Object as seconds, so i can then manipulate it as a date. But sometimes the parse in fails with java.lang.NumberFormatException: multiple points which I think means the value it is trying to parse contains multiple points but how can this be ? The failure does not happen for me so I dont jknow hat the original value is.

getTrackLength() returns a double cast to a an int, and I've tested with fractional floats and it stills always works for me.
private static final SimpleDateFormat timeInFormat = new SimpleDateFormat("ss");
 final long lengthInSecs = getTrackLength();
 final Date timeIn = timeInFormat.parse(String.valueOf(lengthInSecs));
Stacktrace from customer:
java.lang.NumberFormatException: multiple points
at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
at java.lang.Double.parseDouble(Unknown Source)
at java.text.DigitList.getDouble(Unknown Source)
at java.text.DecimalFormat.parse(Unknown Source)
at java.text.SimpleDateFormat.subParse(Unknown Source)
at java.text.SimpleDateFormat.parse(Unknown Source)
at java.text.DateFormat.parse(Unknown Source)
at org.jaudiotagger.audio.mp3.MP3AudioHeader.getTrackLengthAsString(MP3AudioHeader.java:511)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 9 2010
Added on Oct 28 2008
11 comments
22,443 views