aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/sql/Time.java
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2003-04-19 21:17:50 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-04-19 21:17:50 +0000
commita8ada98685bc94b7bbde2865fd685464a18d160d (patch)
tree4fc13305f425cea754f23403e6595e5a31598e3d /libjava/java/sql/Time.java
parentde0656cf30b171cf5a05d2233e4aab26edc56105 (diff)
downloadgcc-a8ada98685bc94b7bbde2865fd685464a18d160d.zip
gcc-a8ada98685bc94b7bbde2865fd685464a18d160d.tar.gz
gcc-a8ada98685bc94b7bbde2865fd685464a18d160d.tar.bz2
Date.java, [...]: New versions from Classpath.
* java/sql/Date.java, java/sql/DriverManager.java, java/sql/Time.java, java/sql/Timestamp.java: New versions from Classpath. From-SVN: r65831
Diffstat (limited to 'libjava/java/sql/Time.java')
-rw-r--r--libjava/java/sql/Time.java89
1 files changed, 85 insertions, 4 deletions
diff --git a/libjava/java/sql/Time.java b/libjava/java/sql/Time.java
index 7d515c2..9200ee3 100644
--- a/libjava/java/sql/Time.java
+++ b/libjava/java/sql/Time.java
@@ -1,5 +1,5 @@
/* Time.java -- Wrapper around java.util.Date
- Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,7 @@ exception statement from your version. */
package java.sql;
+import java.text.ParseException;
import java.text.SimpleDateFormat;
/**
@@ -55,6 +56,82 @@ public class Time extends java.util.Date
*/
private static SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
+ /**
+ * This method always throws an IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException when it's called.
+ * @deprecated
+ */
+ public int getDate() throws IllegalArgumentException
+ {
+ throw new IllegalArgumentException();
+ }
+
+ /**
+ * This method always throws an IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException when it's called.
+ * @deprecated
+ */
+ public int getDay() throws IllegalArgumentException
+ {
+ throw new IllegalArgumentException();
+ }
+
+ /**
+ * This method always throws an IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException when it's called.
+ * @deprecated
+ */
+ public int getMonth() throws IllegalArgumentException
+ {
+ throw new IllegalArgumentException();
+ }
+
+ /**
+ * This method always throws an IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException when it's called.
+ * @deprecated
+ */
+ public int getYear() throws IllegalArgumentException
+ {
+ throw new IllegalArgumentException();
+ }
+
+ /**
+ * This method always throws an IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException when it's called.
+ * @deprecated
+ */
+ public void setDate(int newValue) throws IllegalArgumentException
+ {
+ throw new IllegalArgumentException();
+ }
+
+ /**
+ * This method always throws an IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException when it's called.
+ * @deprecated
+ */
+ public void setMonth(int newValue) throws IllegalArgumentException
+ {
+ throw new IllegalArgumentException();
+ }
+
+ /**
+ * This method always throws an IllegalArgumentException.
+ *
+ * @throws IllegalArgumentException when it's called.
+ * @deprecated
+ */
+ public void setYear(int newValue) throws IllegalArgumentException
+ {
+ throw new IllegalArgumentException();
+ }
/**
* This method returns a new instance of this class by parsing a
@@ -70,11 +147,15 @@ public class Time extends java.util.Date
try
{
java.util.Date d = (java.util.Date) sdf.parseObject(str);
- return new Time(d.getTime());
+
+ if (d == null)
+ throw new IllegalArgumentException(str);
+ else
+ return new Time(d.getTime());
}
- catch (Exception e)
+ catch (ParseException e)
{
- return null;
+ throw new IllegalArgumentException(str);
}
}