diff options
author | 2022-07-06 10:01:58 +0100 | |
---|---|---|
committer | 2022-07-07 16:58:21 +0000 | |
commit | d88c1499efe2f718f3cc1f45a3dc178471b22ce6 (patch) | |
tree | d28e20d9a4f87d2c1fc9a867b111cdc818ff250a /test/182-method-linking/src/Main.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/182-method-linking/src/Main.java')
-rw-r--r-- | test/182-method-linking/src/Main.java | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/test/182-method-linking/src/Main.java b/test/182-method-linking/src/Main.java index 39029560f7..638ff654a3 100644 --- a/test/182-method-linking/src/Main.java +++ b/test/182-method-linking/src/Main.java @@ -33,12 +33,6 @@ import pkg2.I2; public class Main { public static void main(String args[]) { - try { - Class.forName("dalvik.system.PathClassLoader"); - } catch (ClassNotFoundException e) { - usingRI = true; - } - // A single method signature can result in multiple vtable entries // when package-private methods from different packages are involved. // All classes here define the method `void foo()` but classes @@ -120,7 +114,6 @@ public class Main { CXI1 cxi1 = new CXI1(); I1.callI1Foo(cxi1); } catch (IllegalAccessError expected) { - printOnDalvik("Calling pkg1.I1.foo on pkg1.CXI1"); System.out.println("Caught IllegalAccessError"); } @@ -128,7 +121,6 @@ public class Main { CXI2 cxi2 = new CXI2(); I2.callI2Foo(cxi2); } catch (IllegalAccessError expected) { - printOnDalvik("Calling pkg2.I2.foo on pkg1.CXI2"); System.out.println("Caught IllegalAccessError"); } @@ -136,7 +128,6 @@ public class Main { DXI1 dxi1 = new DXI1(); I1.callI1Foo(dxi1); } catch (IllegalAccessError expected) { - printOnDalvik("Calling pkg1.I1.foo on pkg2.DXI1"); System.out.println("Caught IllegalAccessError"); } @@ -144,17 +135,7 @@ public class Main { DXI2 dxi2 = new DXI2(); I2.callI2Foo(dxi2); } catch (IllegalAccessError expected) { - printOnDalvik("Calling pkg2.I2.foo on pkg2.DXI2"); System.out.println("Caught IllegalAccessError"); } } - - private static void printOnDalvik(String line) { - if (!usingRI) { - // FIXME: Delay IAE until calling the method. Bug: 211854716 - System.out.println(line); - } - } - - private static boolean usingRI = false; } |