summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2012-03-12 19:26:50 +0200
committerPekka Enberg <penberg@kernel.org>2012-03-14 20:51:25 +0200
commita3feb1320bfdb19657be48f2131a98c2c8b85997 (patch)
tree280ba7cfcd7fac81bae82856037d3f2856e82a63
parente89f3540066ff03d8b7a7114a17bdc57f0ddfd75 (diff)
downloadclasspath-a3feb1320bfdb19657be48f2131a98c2c8b85997.tar.gz
Add missing Java 1.7 ReflectiveOperationException class
Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r--ChangeLog11
-rw-r--r--java/lang/ClassNotFoundException.java6
-rw-r--r--java/lang/IllegalAccessException.java6
-rw-r--r--java/lang/InstantiationException.java6
-rw-r--r--java/lang/NoSuchFieldException.java6
-rw-r--r--java/lang/NoSuchMethodException.java6
-rw-r--r--java/lang/ReflectiveOperationException.java88
-rw-r--r--java/lang/reflect/InvocationTargetException.java6
8 files changed, 117 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a49ee7ac..50e1c987b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2012-03-12 Pekka Enberg <penberg@kernel.org>
+ * java/lang/ClassNotFoundException,
+ * java/lang/IllegalAccessException.java,
+ * java/lang/InstantiationException.java,
+ * java/lang/NoSuchFieldException.java,
+ * java/lang/NoSuchMethodException.java,
+ * java/lang/ReflectiveOperationException.java,
+ * java/lang/reflect/InvocationTargetException.java:
+ Add ReflectiveOperationException class.
+
+2012-03-12 Pekka Enberg <penberg@kernel.org>
+
* java/lang/AssertionError.java:
(AssertionError): Add missing constructor.
* java/lang/LinkageError.java:
diff --git a/java/lang/ClassNotFoundException.java b/java/lang/ClassNotFoundException.java
index 142bc5d03..fe1424dc2 100644
--- a/java/lang/ClassNotFoundException.java
+++ b/java/lang/ClassNotFoundException.java
@@ -1,5 +1,5 @@
/* ClassNotFoundException.java -- thrown when class definition cannot be found
- Copyright (C) 1998, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2002, 2005, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -47,9 +47,9 @@ package java.lang;
* @see Class#forName(String)
* @see ClassLoader#findSystemClass(String)
* @see ClassLoader#loadClass(String, boolean)
- * @status updated to 1.4
+ * @status updated to 1.7
*/
-public class ClassNotFoundException extends Exception
+public class ClassNotFoundException extends ReflectiveOperationException
{
/**
* Compatible with JDK 1.0+.
diff --git a/java/lang/IllegalAccessException.java b/java/lang/IllegalAccessException.java
index a352c8b1b..2574f6604 100644
--- a/java/lang/IllegalAccessException.java
+++ b/java/lang/IllegalAccessException.java
@@ -1,6 +1,6 @@
/* IllegalAccessException.java -- thrown on attempt to reflect on
inaccessible data
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -71,9 +71,9 @@ import java.lang.reflect.Method;
* @see Field#getDouble(Object)
* @see Method#invoke(Object, Object[])
* @see Constructor#newInstance(Object[])
- * @status updated to 1.4
+ * @status updated to 1.7
*/
-public class IllegalAccessException extends Exception
+public class IllegalAccessException extends ReflectiveOperationException
{
/**
* Compatible with JDK 1.0+.
diff --git a/java/lang/InstantiationException.java b/java/lang/InstantiationException.java
index 367b14bd2..cb2cad154 100644
--- a/java/lang/InstantiationException.java
+++ b/java/lang/InstantiationException.java
@@ -1,6 +1,6 @@
/* InstantiationException.java -- thrown when reflection cannot create an
instance
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,9 +46,9 @@ package java.lang;
* @author Brian Jones
* @author Warren Levy (warrenl@cygnus.com)
* @see Class#newInstance()
- * @status updated to 1.4
+ * @status updated to 1.7
*/
-public class InstantiationException extends Exception
+public class InstantiationException extends ReflectiveOperationException
{
/**
* Compatible with JDK 1.0+.
diff --git a/java/lang/NoSuchFieldException.java b/java/lang/NoSuchFieldException.java
index 74d52d137..b43b53206 100644
--- a/java/lang/NoSuchFieldException.java
+++ b/java/lang/NoSuchFieldException.java
@@ -1,5 +1,5 @@
/* NoSuchFieldException.java -- thrown when reflecting a non-existant field
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -45,9 +45,9 @@ package java.lang;
* @author Brian Jones
* @author Warren Levy (warrenl@cygnus.com)
* @since 1.1
- * @status updated to 1.4
+ * @status updated to 1.7
*/
-public class NoSuchFieldException extends Exception
+public class NoSuchFieldException extends ReflectiveOperationException
{
/**
* Compatible with JDK 1.1+.
diff --git a/java/lang/NoSuchMethodException.java b/java/lang/NoSuchMethodException.java
index e423efb79..116238220 100644
--- a/java/lang/NoSuchMethodException.java
+++ b/java/lang/NoSuchMethodException.java
@@ -1,5 +1,5 @@
/* NoSuchMethodException.java -- thrown when reflecting a non-existant method
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2005, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -44,9 +44,9 @@ package java.lang;
*
* @author Brian Jones
* @author Warren Levy (warrenl@cygnus.com)
- * @status updated to 1.4
+ * @status updated to 1.7
*/
-public class NoSuchMethodException extends Exception
+public class NoSuchMethodException extends ReflectiveOperationException
{
/**
* Compatible with JDK 1.0+.
diff --git a/java/lang/ReflectiveOperationException.java b/java/lang/ReflectiveOperationException.java
new file mode 100644
index 000000000..8b84c0e29
--- /dev/null
+++ b/java/lang/ReflectiveOperationException.java
@@ -0,0 +1,88 @@
+/* ReflectiveOperationException.java -- thrown when reflective operation fails
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package java.lang;
+
+/**
+ * This exception is thrown when reflective operations fail.
+ *
+ * @since 1.7
+ */
+public class ReflectiveOperationException extends Exception
+{
+ private static final long serialVersionUID = 123456789L;
+
+ /**
+ * Create an exception without a message.
+ */
+ public ReflectiveOperationException()
+ {
+ }
+
+ /**
+ * Create an exception with a message.
+ *
+ * @param s the message
+ */
+ public ReflectiveOperationException(String s)
+ {
+ super(s);
+ }
+
+ /**
+ * Create an exception with a message and a cause.
+ *
+ * @param s the message
+ * @param cause the cause, may be null
+ */
+ public ReflectiveOperationException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ /**
+ * Create an exception with a cause.
+ *
+ * @param cause the cause, may be null
+ */
+ public ReflectiveOperationException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
diff --git a/java/lang/reflect/InvocationTargetException.java b/java/lang/reflect/InvocationTargetException.java
index af79d3a19..4480fc6d0 100644
--- a/java/lang/reflect/InvocationTargetException.java
+++ b/java/lang/reflect/InvocationTargetException.java
@@ -1,5 +1,5 @@
/* InvocationTargetException.java -- Wrapper exception for reflection
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2012 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -50,9 +50,9 @@ package java.lang.reflect;
* @see Method#invoke(Object,Object[])
* @see Constructor#newInstance(Object[])
* @since 1.1
- * @status updated to 1.4
+ * @status updated to 1.7
*/
-public class InvocationTargetException extends Exception
+public class InvocationTargetException extends ReflectiveOperationException
{
/**
* Compatible with JDK 1.1+.