Looks like they're tightening the spec... http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6898593
On Jan 14, 1:40 pm, "[email protected]" <[email protected]> wrote: > I agree with your comments that this might actually be a fix of the > 6u17 (and before) implementation. > > Still, it might take many users, unhappily by surprise. > > On Jan 14, 1:32 pm, B Smith-Mannschott <[email protected]> wrote: > > > > > On Thu, Jan 14, 2010 at 19:09, [email protected] > > > <[email protected]> wrote: > > > This program runs without throwing an exception in 6u17 but fails in > > > 6u18 > > > > public class SqlDate { > > > public static void main(String[] args) { > > > System.out.println(java.sql.Date.valueOf > > > ("2009-07-01")); > > > System.out.println(java.sql.Date.valueOf > > > ("2009-7-1")); // Crashes in 6u18 > > > } > > > } > > > > I've submitted a bug to sun but can anyone else replicate this? > > > Interesting. What you're seeing is a change in *undocumented* > > behavior. valueOf doesn't promise to handle that syntax. Both JDK5 and > > JDK6 are documented thus: > > > public static Date valueOf(String s) > > Converts a string in JDBC date escape format to a Date value. > > Parameters: s - a String object representing a date in in the format > > "yyyy-mm-dd" > > Returns: a java.sql.Date object representing the given date > > Throws: IllegalArgumentException - if the date given is not in the > > JDBC date escape format (yyyy-mm-dd) > > > In fact, one could argue that 6u18 brings the fixes the fact that 6u17 > > didn't behave as documented.
-- You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
