diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-19 21:17:50 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-19 21:17:50 +0000 |
commit | f8907024406fff51c1aa7fa38af21a4c0ef33178 (patch) | |
tree | 4fc13305f425cea754f23403e6595e5a31598e3d /libjava/java/sql/Date.java | |
parent | 3c04ceca015e4af690bacc197f6d460584c54380 (diff) | |
download | ppe42-gcc-f8907024406fff51c1aa7fa38af21a4c0ef33178.tar.gz ppe42-gcc-f8907024406fff51c1aa7fa38af21a4c0ef33178.zip |
* java/sql/Date.java, java/sql/DriverManager.java,
java/sql/Time.java, java/sql/Timestamp.java: New versions from
Classpath.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65831 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/sql/Date.java')
-rw-r--r-- | libjava/java/sql/Date.java | 81 |
1 files changed, 76 insertions, 5 deletions
diff --git a/libjava/java/sql/Date.java b/libjava/java/sql/Date.java index 360376c2518..67d5eb7af01 100644 --- a/libjava/java/sql/Date.java +++ b/libjava/java/sql/Date.java @@ -1,5 +1,5 @@ /* Date.java -- Wrapper around java.util.Date - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -37,6 +37,7 @@ exception statement from your version. */ package java.sql; +import java.text.ParseException; import java.text.SimpleDateFormat; /** @@ -82,6 +83,72 @@ public class Date extends java.util.Date } /** + * This method always throws an IllegalArgumentException. + * + * @throws IllegalArgumentException when it's called. + * @deprecated + */ + public int getHours() throws IllegalArgumentException + { + throw new IllegalArgumentException(); + } + + /** + * This method always throws an IllegalArgumentException. + * + * @throws IllegalArgumentException when it's called. + * @deprecated + */ + public int getMinutes() throws IllegalArgumentException + { + throw new IllegalArgumentException(); + } + + /** + * This method always throws an IllegalArgumentException. + * + * @throws IllegalArgumentException when it's called. + * @deprecated + */ + public int getSeconds() throws IllegalArgumentException + { + throw new IllegalArgumentException(); + } + + /** + * This method always throws an IllegalArgumentException. + * + * @throws IllegalArgumentException when it's called. + * @deprecated + */ + public void setHours(int newValue) throws IllegalArgumentException + { + throw new IllegalArgumentException(); + } + + /** + * This method always throws an IllegalArgumentException. + * + * @throws IllegalArgumentException when it's called. + * @deprecated + */ + public void setMinutes(int newValue) throws IllegalArgumentException + { + throw new IllegalArgumentException(); + } + + /** + * This method always throws an IllegalArgumentException. + * + * @throws IllegalArgumentException when it's called. + * @deprecated + */ + public void setSeconds(int newValue) throws IllegalArgumentException + { + throw new IllegalArgumentException(); + } + + /** * This method returns a new instance of this class by parsing a * date in JDBC format into a Java date. * @@ -92,14 +159,18 @@ public class Date extends java.util.Date */ public static Date valueOf (String str) { - try + try { java.util.Date d = (java.util.Date) sdf.parseObject(str); - return(new Date(d.getTime())); + + if (d == null) + throw new IllegalArgumentException(str); + else + return new Date(d.getTime()); } - catch(Exception e) + catch (ParseException e) { - return(null); + throw new IllegalArgumentException(str); } } |