That's helpful clarification. If it's that infrequent, then it will
certainly be hard to reproduce. And yet, I still can't imagine how it would
happen so I'm only more intrigued. Is it wrong of me to wish you the
misfortune of having it happen again? ;)
On Thursday, April 19, 2012 7:42:06 AM UTC-4, Anjum Naseer wrote:
> Hi Ian,
> It hasn’t occurred again yet. Just to be clear, intermittently here means
> that it happened twice in the past 3 weeks. So maybe I should have said
> “rarely” rather than intermittently.
> I’ll let you if it does occur again.
> Thanks,
> Anjum
> *From:* versionone-dev@googlegroups.com [mailto:
> versionone-dev@googlegroups.com] *On Behalf Of *Anjum Naseer
> *Sent:* 18 April 2012 13:32
> *To:* versionone-dev@googlegroups.com
> *Subject:* RE: I am getting a NumberFormatException intermittently when
> reading the historical records of a Task [Latest Java ApiClient]
> Ian,
> I have amended the relevant code to this:
> try {
> setDate(format.parse(strValue));
> } catch (final ParseException e) {
> throw new RuntimeException("Cannot Parse Value ["+strValue+"] using format
> ["+format+"]", e);
> } catch (final RuntimeException e) {
> throw new
> RuntimeException("Cannot Parse Value ["+strValue+"] using format
> ["+format+"]", e);
> }
> And will let you have the details when it occurs again.
> Thanks,
> Anjum.
> *From:* versionone-dev@googlegroups.com [
> mailto:versionone-dev@googlegroups.com <versionone-dev@googlegroups.com>]
> *On Behalf Of *ibuchanan
> *Sent:* 18 April 2012 13:08
> *To:* versionone-dev@googlegroups.com
> *Subject:* Re: I am getting a NumberFormatException intermittently when
> reading the historical records of a Task [Latest Java ApiClient]
> Anjum,
> It does look like a problem that the SDK catches the wrong kind of
> exception. I'll put a story in our backlog to address it. That said, it's
> not exactly an explanation. I wonder if you could add the strValue to the
> exception and recompile so we can learn a little more about the root cause.
> I have a hard time imagining how the ChangeDate could be coming back as
> something other than a parseable date. And the fact that it's intermitent
> puzzles me, too.
> Yours truly,
> Ian Buchanan
> Product Manager for Platform and Integrations
> On Wednesday, April 18, 2012 7:52:41 AM UTC-4, Anjum Naseer wrote:
> I tracked this down to com.versionone.DB – the constructor at line 481
> is coded as follows:
> 481: public DateTime(Object value) {
> 482: if ((value != null) &&
> (!(value instanceof NullObject))) {
> 483: if (value
> instanceof String) {
> 484:
> String strValue = (String) value;
> 485:
> if (!strValue.equals("")) {
> 486:
> final SimpleDateFormat format;
> 487:
> if (strValue.contains("T")) {
> 488:
> format = DAY_N_TIME_FORMAT;
> 489:
> } else {
> 490:
> format = DAY_FORMAT;
> 491:
> }
> 492://
> format.setTimeZone(TimeZone.getTimeZone("UTC"));
> 493:
> try {
> 494:
> setDate(format.parse(strValue));
> 495:
> } catch (ParseException e) {
> 496:
> throw new RuntimeException("Cannot Parse Value", e);
> 497:
> }
> 498:
> }
> 499: } else if
> (value instanceof Date) {
> 500:
> setDate((Date) value);
> 501: } else if
> (value instanceof DateTime) {
> 502:
> DateTime other = (DateTime) value;
> 503:
> if (!other.isNull())
> 504:
> setDate(other.getValue());
> 505: } else
> 506:
> throw new RuntimeException(UnknownConversionMessage(value));
> 507: }
> 508: }
> It throws at line 494 in this file.
> I noticed that if this throws a ParseException then it is converted to a
> RuntimeException at line 496.
> It might be useful to add the value of strValue to this exception to aid
> diagnostics.
> The actual exception thrown in this case is a NumberFormatException so it
> wouldn’t be caught. It might be worth catching this as well so that you can
> add more context to the exception message before re-throwing it.
> Thanks,
> Anjum
> *From:* versionone-dev@googlegroups.com [mailto:
> versionone-dev@googlegroups.com] *On Behalf Of *Anjum Naseer
> *Sent:* 18 April 2012 12:32
> *To:* versionone-dev@googlegroups.com
> *Subject:* I am getting a NumberFormatException intermittently when
> reading the historical records of a Task [Latest Java ApiClient]
> java.util.concurrent.ExecutionException: java.lang.NumberFormatException:
> multiple points
> at
> java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
> at java.util.concurrent.FutureTask.get(FutureTask.java:111)
> at javax.swing.SwingWorker.get(SwingWorker.java:602)
> at
> com.teamphone.versionone.dashboard.views.TaskWorkflowPanel$WorkflowUpdator. done(TaskWorkflowPanel.java:190)
> at javax.swing.SwingWorker$5.run(SwingWorker.java:737)
> at
> javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(SwingWorker.java:8 32)
> at
> sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
> at
> javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(SwingW orker.java:842)
> at javax.swing.Timer.fireActionPerformed(Timer.java:312)
> at javax.swing.Timer$DoPostEvent.run(Timer.java:244)
> at
> java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
> at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
> at java.awt.EventQueue.access$000(EventQueue.java:101)
> at java.awt.EventQueue$3.run(EventQueue.java:666)
> at java.awt.EventQueue$3.run(EventQueue.java:664)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.j ava:76)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
> at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.jav a:211)
> at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:1 28)
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.jav a:117)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
> Caused by: java.lang.NumberFormatException: multiple points
> at
> sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1101)
> at java.lang.Double.parseDouble(Double.java:540)
> at java.text.DigitList.getDouble(DigitList.java:168)
> at java.text.DecimalFormat.parse(DecimalFormat.java:1321)
> at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:2089)
> at
...