Change generated lambda classes to be public
Bug: 72538146
Change-Id: Ic316e5f96f1c1cd7dfc12ca1ab21477b6bb1a90c
diff --git a/src/test/examplesAndroidApi/classloader/Runner.java b/src/test/examplesAndroidApi/classloader/Runner.java
new file mode 100644
index 0000000..4660559
--- /dev/null
+++ b/src/test/examplesAndroidApi/classloader/Runner.java
@@ -0,0 +1,36 @@
+// Copyright (c) 2018, the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+package classloader;
+
+import java.lang.reflect.Method;
+
+import dalvik.system.PathClassLoader;
+
+// Command line application which take three arguments:
+//
+// Parent dex file
+// Child dex file
+// Main class name
+//
+// The application will create a classloader hierachy with the parent dex file above the
+// system class loader, and the child dex file above the parent dex file. The it will load the
+// Main class from the child dex file class loader and run its main method.
+public class Runner {
+ public static void main(String[] args) throws Exception {
+ String parentFile = args[0];
+ String childFile = args[1];
+ String childClassName = args[2];
+ ClassLoader parentClassLoader =
+ new PathClassLoader(parentFile, ClassLoader.getSystemClassLoader());
+ ClassLoader childClassLoader = new PathClassLoader(childFile, parentClassLoader);
+
+ Class<?> childClass = childClassLoader.loadClass(childClassName);
+ runMain(childClass, new String[0]);
+ }
+
+ private static void runMain(Class<?> clazz, String[] args) throws Exception {
+ Method m = clazz.getMethod("main", String[].class);
+ m.invoke(null, new Object[] { args });
+ }
+}