summaryrefslogtreecommitdiff
path: root/test/ProfileTestMultiDex/Second.java
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2019-02-02 20:08:44 +0000
committerDavid Brazdil <dbrazdil@google.com>2019-02-04 15:00:20 +0000
commit4bcd65753c1e49ceba2c41983f26af81ae319670 (patch)
tree3fc7bd53d37448621726dc508f173490807af9c7 /test/ProfileTestMultiDex/Second.java
parent2da3cbb4af20a64108e474c0bbbe0cc5d3af2aa2 (diff)
Take hidden API into account during getDeclaredMethod()
Generics make it possible for two methods to have the same name and list of parameters but differ in their return type. Class.getDeclaredMethod() does not allow callers to specify the type, so either of the matching methods can be returned (ART will prefer the non-synthetic one). However, Class::GetDeclaredMethodInternal() did not use to take hidden API into account and could return a hidden method, despite a non-hidden one being available. The reflective call would then reject the method and throw NoSuchMethodException. This patch modifies Class:GetDeclaredMethodInternal() to consider: (a) hidden/non-hidden (b) virtual/direct (c) synthetic/non-synthetic in that decreasing order of importance and pick the best matching method. The hiddenness checks are performed with AccessMethod::kNone so as to not trigger warnings. A hidden method may still be returned and the caller should do the access check again with the appropriate AccessMethod. Bug: 122291025 Test: art/test.py -r -t 690-hiddenapi-same-name-methods Change-Id: Iaee780c1e87f5587f51e24b517b2b37101c729e3
Diffstat (limited to 'test/ProfileTestMultiDex/Second.java')
0 files changed, 0 insertions, 0 deletions