SimpleDateFormat parse bug: doesn't like embedded spaces

Bryce McKinlay
Sat Feb 4 00:54:00 GMT 2006

Scott Gilbertson wrote:
> I found a difference between SimpleDateFormat.parse in GCJ/Classpath vs.
> Sun.  Tiny test program attached.
> The attached program runs the following strings:
>     "2:03:34"
>     "2: 3:34"
> Through this SimpleDateFormat:
>     new SimpleDateFormat ("H':'m':'s")
> The result with GCJ (from svn a Jan 24) is different from Sun JRE 1.4.2_08\

Hmm, another undocumented behaviour of Sun's class libraries. The 
attached patch should make us compatible. We'll need to add a mauve test 
for this, too.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: simpledateformat-whitespace.patch
Type: text/x-patch
Size: 1145 bytes
Desc: not available
URL: <>

More information about the Java mailing list