summaryrefslogtreecommitdiffstats
path: root/luni
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-06-06 20:51:33 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-06-06 20:51:33 +0000
commit04d92ec6fd445613801688f45fa934cf39190605 (patch)
treecdda7538a2523be5305c2a01b1094bb3fc3803ab /luni
parent28d0eab796d6f9e990c8d8393e1769ac27892d7c (diff)
parente91d1c4ef333b6b65cf1c902e683b2f8cd699d3f (diff)
downloadlibcore-04d92ec6fd445613801688f45fa934cf39190605.zip
libcore-04d92ec6fd445613801688f45fa934cf39190605.tar.gz
libcore-04d92ec6fd445613801688f45fa934cf39190605.tar.bz2
Merge "Add ReflectiveOperationException."
Diffstat (limited to 'luni')
-rw-r--r--luni/src/main/java/java/lang/ClassNotFoundException.java2
-rw-r--r--luni/src/main/java/java/lang/IllegalAccessException.java2
-rw-r--r--luni/src/main/java/java/lang/InstantiationException.java2
-rw-r--r--luni/src/main/java/java/lang/NoSuchFieldException.java2
-rw-r--r--luni/src/main/java/java/lang/NoSuchMethodException.java2
-rw-r--r--luni/src/main/java/java/lang/ReflectiveOperationException.java53
-rw-r--r--luni/src/main/java/java/lang/reflect/InvocationTargetException.java2
7 files changed, 59 insertions, 6 deletions
diff --git a/luni/src/main/java/java/lang/ClassNotFoundException.java b/luni/src/main/java/java/lang/ClassNotFoundException.java
index 2ac3b49..c7ac51d 100644
--- a/luni/src/main/java/java/lang/ClassNotFoundException.java
+++ b/luni/src/main/java/java/lang/ClassNotFoundException.java
@@ -20,7 +20,7 @@ package java.lang;
/**
* Thrown when a class loader is unable to find a class.
*/
-public class ClassNotFoundException extends Exception {
+public class ClassNotFoundException extends ReflectiveOperationException {
private static final long serialVersionUID = 9176873029745254542L;
diff --git a/luni/src/main/java/java/lang/IllegalAccessException.java b/luni/src/main/java/java/lang/IllegalAccessException.java
index 4625395..63fae94 100644
--- a/luni/src/main/java/java/lang/IllegalAccessException.java
+++ b/luni/src/main/java/java/lang/IllegalAccessException.java
@@ -21,7 +21,7 @@ package java.lang;
* Thrown when a program attempts to access a field or method which is not
* accessible from the location where the reference is made.
*/
-public class IllegalAccessException extends Exception {
+public class IllegalAccessException extends ReflectiveOperationException {
private static final long serialVersionUID = 6616958222490762034L;
diff --git a/luni/src/main/java/java/lang/InstantiationException.java b/luni/src/main/java/java/lang/InstantiationException.java
index a5f288b..d08cc75 100644
--- a/luni/src/main/java/java/lang/InstantiationException.java
+++ b/luni/src/main/java/java/lang/InstantiationException.java
@@ -21,7 +21,7 @@ package java.lang;
* Thrown when a program attempts to access a constructor which is not
* accessible from the location where the reference is made.
*/
-public class InstantiationException extends Exception {
+public class InstantiationException extends ReflectiveOperationException {
private static final long serialVersionUID = -8441929162975509110L;
/**
diff --git a/luni/src/main/java/java/lang/NoSuchFieldException.java b/luni/src/main/java/java/lang/NoSuchFieldException.java
index bea6ecb..9cb88d0 100644
--- a/luni/src/main/java/java/lang/NoSuchFieldException.java
+++ b/luni/src/main/java/java/lang/NoSuchFieldException.java
@@ -21,7 +21,7 @@ package java.lang;
* Thrown when the VM notices that a program tries to reference,
* on a class or object, a field that does not exist.
*/
-public class NoSuchFieldException extends Exception {
+public class NoSuchFieldException extends ReflectiveOperationException {
private static final long serialVersionUID = -6143714805279938260L;
diff --git a/luni/src/main/java/java/lang/NoSuchMethodException.java b/luni/src/main/java/java/lang/NoSuchMethodException.java
index 7cae49b..568547b 100644
--- a/luni/src/main/java/java/lang/NoSuchMethodException.java
+++ b/luni/src/main/java/java/lang/NoSuchMethodException.java
@@ -21,7 +21,7 @@ package java.lang;
* Thrown when the VM notices that a program tries to reference,
* on a class or object, a method that does not exist.
*/
-public class NoSuchMethodException extends Exception {
+public class NoSuchMethodException extends ReflectiveOperationException {
private static final long serialVersionUID = 5034388446362600923L;
diff --git a/luni/src/main/java/java/lang/ReflectiveOperationException.java b/luni/src/main/java/java/lang/ReflectiveOperationException.java
new file mode 100644
index 0000000..835379c
--- /dev/null
+++ b/luni/src/main/java/java/lang/ReflectiveOperationException.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+import java.lang.reflect.Array;
+
+/**
+ * Superclass of exceptions related to reflection.
+ *
+ * @since 1.7
+ */
+public class ReflectiveOperationException extends Exception {
+ /**
+ * Constructs a new exception with no detail message.
+ */
+ public ReflectiveOperationException() {
+ }
+
+ /**
+ * Constructs a new exception with the given detail message.
+ */
+ public ReflectiveOperationException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new exception with the given cause.
+ */
+ public ReflectiveOperationException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new exception with the given detail message and cause.
+ */
+ public ReflectiveOperationException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/luni/src/main/java/java/lang/reflect/InvocationTargetException.java b/luni/src/main/java/java/lang/reflect/InvocationTargetException.java
index a87441f..ee75a0e 100644
--- a/luni/src/main/java/java/lang/reflect/InvocationTargetException.java
+++ b/luni/src/main/java/java/lang/reflect/InvocationTargetException.java
@@ -24,7 +24,7 @@ package java.lang.reflect;
* @see Method#invoke
* @see Constructor#newInstance
*/
-public class InvocationTargetException extends Exception {
+public class InvocationTargetException extends ReflectiveOperationException {
private static final long serialVersionUID = 4085088731926701167L;