summaryrefslogtreecommitdiffstats
path: root/libart
diff options
context:
space:
mode:
Diffstat (limited to 'libart')
-rw-r--r--libart/src/main/java/java/lang/reflect/AccessibleObject.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/libart/src/main/java/java/lang/reflect/AccessibleObject.java b/libart/src/main/java/java/lang/reflect/AccessibleObject.java
index dd57a12..a1e2743 100644
--- a/libart/src/main/java/java/lang/reflect/AccessibleObject.java
+++ b/libart/src/main/java/java/lang/reflect/AccessibleObject.java
@@ -71,6 +71,13 @@ public class AccessibleObject implements AnnotatedElement {
* IllegalAccessExceptions}.
*/
public void setAccessible(boolean flag) {
+ try {
+ if (equals(Class.class.getDeclaredConstructor())) {
+ throw new SecurityException("Can't make class constructor accessible");
+ }
+ } catch (NoSuchMethodException e) {
+ throw new AssertionError("Couldn't find class constructor");
+ }
this.flag = flag;
}