Re: svn commit: r209692 - in /incubator/jdo/trunk/api20: src/java/javax/jdo/
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache JDO Project > Re: svn commit: r209692 - in /incubator/jdo/trunk/api20: src/java/javax/jdo/




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: svn commit: r209692 - in /incubator/jdo/trunk/api20: src/java/javax/jdo/  
Michael Bouschen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-08-05 12:45 PM

Hi Michael,

as Andy pointed out, this is a date parsing error. You find the error
stack trace in TEST-javax.jdo.identity.ObjectIdentityTest.txt under
target/test-reports.

The JDOImplHelper parses Date string using a DateFormat instance
retrieved by calling DateFormat.getDateTimeInstance. The no-arg version
of getDateTimeInstance uses the default locale which is different for
Craig and you (Locale.US vs. Locale.GERMANY). The ObjectIdentityTest
specifies date strings in US format: 'Jan 01, 1970 00:00:00 AM' which
does not parse with a DateFormat using the German locale.

A possible solution could be using the US locale when creating the
DateFormat. Replace dateFormat definition on line 94 of JDOImplHelper
with the following line:
static DateFormat dateFormat = DateFormat.getDateTimeInstance(
DateFormat.DEFAULT, DateFormat.DEFAULT, Locale.US);
Then all the test cases pass. The downside is that this hard codes the
US locale in the JDOImplHelper code. Maybe the JDOImplHelper could use
the US locale as the default, but provide a way to override this. It
already provides a method registerDateFormat to override the
dateFormatPattern, but this needs to be in sync with the locale of the
dateFormat instance.

Regards Michael
 
>
>You mean the failed test ?
>This is the error. Looks like some date parsing needs a fix in JDOImplHelpe
r.
>
>javax.jdo.JDOUserException: Error parsing Date string "Jan 01, 1970 00:00:0
0
>AM" at position 0 using date format "MMM d, yyyy hh:mm:ss a".
>at javax.jdo.spi.JDOImplHelper$3.construct(JDOImplHelper.java:580)
>        at javax.jdo.spi.JDOImplHelper.construct(JDOImplHelper.java:610)
>        at javax.jdo.identity.ObjectIdentity.<init>(ObjectIdentity.java:86)
>        at
>javax.jdo.identity.ObjectIdentityTest.testStringDateConstructor(ObjectIdent
ityTest.java:202)
>
>
>HTH
>
>


--
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66
Fax.:++49/30/2175 2012		D-10783 Berlin







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:19 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register