11 Replies Latest reply: Feb 9, 2010 1:21 AM by 791266 RSS

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

    502559
      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)