Add access checks to Method and Field reflection.
Art side of this change. Has a corresponding libcore change.
Bug: 13620925
Change-Id: Ie67f802a2a400e8212b489b9a261b7028422d8ba
diff --git a/test/046-reflect/src/Main.java b/test/046-reflect/src/Main.java
index dfb0d8f..d60fcb4 100644
--- a/test/046-reflect/src/Main.java
+++ b/test/046-reflect/src/Main.java
@@ -335,11 +335,12 @@
System.out.println(" cantTouchThis is " + intVal);
try {
field.setInt(instance, 99);
+ System.out.println("ERROR: set-final did not throw exception");
} catch (IllegalAccessException iae) {
- System.out.println("ERROR: set-final failed");
+ System.out.println(" as expected: set-final throws exception");
}
intVal = field.getInt(instance);
- System.out.println(" cantTouchThis is now " + intVal);
+ System.out.println(" cantTouchThis is still " + intVal);
System.out.println(" " + field + " accessible=" + field.isAccessible());
field.setAccessible(true);