diff options
author | 2022-07-06 10:01:58 +0100 | |
---|---|---|
committer | 2022-07-07 16:58:21 +0000 | |
commit | d88c1499efe2f718f3cc1f45a3dc178471b22ce6 (patch) | |
tree | d28e20d9a4f87d2c1fc9a867b111cdc818ff250a /test/840-resolution/src2/SuperClass.java | |
parent | 4a21275dfb1bc58ede8141cbfd103ad46c3fcf2d (diff) |
Fix one edge case at method linking to throw at runtime.
If we could not find a public implementation for a public method, throw
an IllegalAccessError at runtime, when the method is actually called,
instead of when the class is being created.
Test: 840-resolution
Test: 182-method-linking
Change-Id: I741c7d0f6fc3b90a5d1614e1a9b76985a2eb32e2
Diffstat (limited to 'test/840-resolution/src2/SuperClass.java')
-rw-r--r-- | test/840-resolution/src2/SuperClass.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/840-resolution/src2/SuperClass.java b/test/840-resolution/src2/SuperClass.java new file mode 100644 index 0000000000..fe40c0a060 --- /dev/null +++ b/test/840-resolution/src2/SuperClass.java @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2022 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. + */ + +class SuperClass { + Class<?> foo() { + return SuperClass.class; + } +} |