History log of /art/test/046-reflect/src/Main.java
Revision Date Author Comments
af50e415a187190488d4694f307c23705203c53e 28-Jul-2015 Fredrik Roubert <roubert@google.com> Bugfix: Java char is 16 bits, can not be treated as boolean.

Using SetFieldBooleanVolatile() and SetFieldBoolean() happens to work
for char values that only use the lower 8 bits, but is a mistake that
was introduced by the "Add AccessibleObject and Field to mirror" commit:

https://android.googlesource.com/platform/art/+/daaf326

(cherry picked from commit 3152c82b0d33e5fb0a4aa964ea58451c72734444)

Bug:22772717

Change-Id: Iec02ba3084c992ea239ecef688d7d29c7e21ae16
3beb245da9392818e3154d47593f82cf0ef69aac 13-May-2015 Mathieu Chartier <mathieuc@google.com> Also print class for NoSuchFieldException

Example message:
Caused by: java.lang.NoSuchFieldException: No field value in class Ljava/lang/String;

Added test.

Bug: 20881251

Change-Id: I4043cbf26c3077952b6c151da0d0edd980da26b1
ca239af73e512df5eeb80fe6c09c2ca614649e06 30-Mar-2015 Mathieu Chartier <mathieuc@google.com> Fix some reflection errors

Fixed incorrectly using 2nd frame instead of 1st in VerifyAccess.
Added regression test to ART. Fixed broken setShort,
getDeclaredFieldInternal.

Change-Id: I4b21d52d998cb768fe9503b8bccec506b7b972e5
daaf3265806eb2eadb2e03302bd68022fab5ca28 24-Mar-2015 Mathieu Chartier <mathieuc@google.com> Add AccessibleObject and Field to mirror

Main motivation is to remove all the functionality / field access on
java side to ArtField. Also comes with some reflection speedups /
slowdowns.

Summary results:
getDeclaredField/getField are slower mostly due to JNI overhead.
However, there is a large speedup in getInt, setInt,
GetInstanceField, and GetStaticField.

Before timings (N5 --compiler-filter=everything):

benchmark ns linear runtime
Class_getDeclaredField 782.86 ===
Class_getField 832.77 ===
Field_getInt 160.17 =
Field_setInt 195.88 =
GetInstanceField 3214.38 ==============
GetStaticField 6809.49 ==============================

After:
Class_getDeclaredField 1068.15 ============
Class_getField 1180.00 ==============
Field_getInt 121.85 =
Field_setInt 139.98 =
GetInstanceField 1986.15 =======================
GetStaticField 2523.63 ==============================

Bug: 19264997

Change-Id: Ic0d0fc1b56b95cd6d60f8e76f19caeaa23045c77
e3b173fa54c67e0b3d4cea583cd999b074c810a9 06-Aug-2014 Piotr Jastrzebski <haaawk@google.com> Add test for equals and hashCode in ParameterizedType

and GenericArrayType.

Bug: 14590652
Bug: https://code.google.com/p/android/issues/detail?id=74060

(cherry picked from commit 68b539ed7be2762bcab43f1c05174ef4a1d15625)

Change-Id: I9930d767b62658122981bc7550d150a78eeba943
3ed4c549ac05dce7f7984746f8d07348fd4074d9 09-Aug-2014 Mathieu Chartier <mathieuc@google.com> Add tests for getDeclaredConstructor

Ensure that getDeclaredConstructor throws exceptions for classes,
fields, and methods.

Bug: 16866726
Change-Id: I6f1a1252b9a409dee80653c25ae196db48dc004e
68b539ed7be2762bcab43f1c05174ef4a1d15625 06-Aug-2014 Piotr Jastrzebski <haaawk@google.com> Add test for equals and hashCode in ParameterizedType

and GenericArrayType.

Bug: 14590652
Bug: https://code.google.com/p/android/issues/detail?id=74060
Change-Id: Ic814bcc24b1461b42ac809eaaa7a41d9f5a60406
63f5b9e8f660ae761901072821ece30d87891644 23-Apr-2014 Jeff Hao <jeffhao@google.com> Add test that Class.newInstance does not wrap its exceptions.

Unlike Constructor.newInstance, Class.newInstance should not wrap
exceptions it throws.

Bug: https://code.google.com/p/android/issues/detail?id=68620

Change-Id: I47d78904e72f299284d1382bc715ab120d3b1a7f
11d5d8fffe41cc7daadbfa2ca98ecb978f3029af 26-Mar-2014 Jeff Hao <jeffhao@google.com> Add access checks to Method and Field reflection.

Art side of this change. Has a corresponding libcore change.

Bug: 13620925
Change-Id: Ie67f802a2a400e8212b489b9a261b7028422d8ba
ea46f950e7a51585db293cd7f047de190a482414 30-Jul-2013 Brian Carlstrom <bdc@google.com> Refactor java.lang.reflect implementation

Cherry-picked from commit ed41d5c44299ec5d44b8514f6e17f802f48094d1.

Move to ArtMethod/Field instead of AbstractMethod/Field and have
java.lang.reflect APIs delegate to ArtMethod/ArtField.

Bug: 10014286.

Change-Id: Iafc1d8c5b62562c9af8fb9fd8c5e1d61270536e7
7a549467e332398229724058c07d998d0acfb0bb 19-Mar-2013 Jeff Hao <jeffhao@google.com> Pass NULL as receiver for static methods for ArgArray builder.

The receiver field is ignored for static methods, and may be null, but it
could be anything. Changed test 46 to make sure the value is properly
handled when it is not null.

Change-Id: Ide182b99c40a757e158f3587de7b413cd0cbb089
923e8b8e936ead33408e111682aa9372e3a7ed43 23-Mar-2012 Elliott Hughes <enh@google.com> Expand test 046 and move reflective class initialization later.

We have no reason to do this later; we're just being conservative. We
might want to revisit this in a future release so you only pay once,
when you cache your Field or Method instance.

Change-Id: Ib18fa75c0648561d3c5e1554cb3955ed57ab9314
741b5b7ef4c7fd4a786364bbf60d515489caff47 01-Feb-2012 Elliott Hughes <enh@google.com> Manually merge my AOSP update to the VM tests.

Original change: https://android-review.googlesource.com/32051

Bug: http://code.google.com/p/android/issues/detail?id=21599
Bug: http://code.google.com/p/android/issues/detail?id=21597
Change-Id: I31e440b66b720647afab54ca39fd6eb1bbb0cb60
2faa5f1271587cda765f26bcf2951065300a01ff 30-Jan-2012 Elliott Hughes <enh@google.com> Fix copyright headers.

Change-Id: I5b7bc76a370238d810d78522bd5531600746700f
f3778f66879fa038a7c9ebe46d5bc4167ddef7d8 26-Jan-2012 Elliott Hughes <enh@google.com> Fix test 046.

Looks like a recent change put us on an untested code path, and we need
to start distinguishing callers' intentions. We can also remove some
unnecessary duplication.

Change-Id: I950139e6fdc8656b89d8e1520e8b50f681c7f7b2
582a7d16bb0db323d8bd730beb61578aa3765f43 11-Oct-2011 Elliott Hughes <enh@google.com> Fix a handful of reflection bugs.

We now pass test 046.

Change-Id: Ie605ed99e64038435608fe388c59526674af5489
5d1ac920fdaef5d4ec8f66bb734488cd9660b024 30-Sep-2011 jeffhao <jeffhao@google.com> Adding old unit tests to test suite.

These tests are copied straight over. They'll still run, but they're
using the old system.

Change-Id: If494519e52ddf858a9febfc55bdae830468cb3c8