summaryrefslogtreecommitdiff
path: root/test/616-cha-proxy-method-inline
diff options
context:
space:
mode:
Diffstat (limited to 'test/616-cha-proxy-method-inline')
-rw-r--r--test/616-cha-proxy-method-inline/run.py (renamed from test/616-cha-proxy-method-inline/run)6
-rw-r--r--test/616-cha-proxy-method-inline/src-multidex/Foo.java2
-rw-r--r--test/616-cha-proxy-method-inline/src/Main.java76
3 files changed, 42 insertions, 42 deletions
diff --git a/test/616-cha-proxy-method-inline/run b/test/616-cha-proxy-method-inline/run.py
index d8b4f0d26c..1e797a8e43 100644
--- a/test/616-cha-proxy-method-inline/run
+++ b/test/616-cha-proxy-method-inline/run.py
@@ -14,5 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Run without an app image to prevent the classes to be loaded at startup.
-exec ${RUN} "${@}" --no-app-image
+
+def run(ctx, args):
+ # Run without an app image to prevent the classes to be loaded at startup.
+ ctx.default_run(args, app_image=False)
diff --git a/test/616-cha-proxy-method-inline/src-multidex/Foo.java b/test/616-cha-proxy-method-inline/src-multidex/Foo.java
index 9deca3e646..135214d617 100644
--- a/test/616-cha-proxy-method-inline/src-multidex/Foo.java
+++ b/test/616-cha-proxy-method-inline/src-multidex/Foo.java
@@ -15,5 +15,5 @@
*/
interface Foo {
- public Object bar(Object obj);
+ public Object bar(Object obj);
}
diff --git a/test/616-cha-proxy-method-inline/src/Main.java b/test/616-cha-proxy-method-inline/src/Main.java
index be7bc820b3..627c15c2a5 100644
--- a/test/616-cha-proxy-method-inline/src/Main.java
+++ b/test/616-cha-proxy-method-inline/src/Main.java
@@ -18,53 +18,51 @@ import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
class DebugProxy implements java.lang.reflect.InvocationHandler {
- private Object obj;
- static Class<?>[] interfaces = {Foo.class};
+ private Object obj;
+ static Class<?>[] interfaces = {Foo.class};
- public static Object newInstance(Object obj) {
- return java.lang.reflect.Proxy.newProxyInstance(
- Foo.class.getClassLoader(),
- interfaces,
- new DebugProxy(obj));
- }
-
- private DebugProxy(Object obj) {
- this.obj = obj;
- }
+ public static Object newInstance(Object obj) {
+ return java.lang.reflect.Proxy.newProxyInstance(
+ Foo.class.getClassLoader(), interfaces, new DebugProxy(obj));
+ }
- public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
- Object result;
- if (obj == null) {
- return null;
+ private DebugProxy(Object obj) {
+ this.obj = obj;
}
- try {
- System.out.println("before invoking method " + m.getName());
- result = m.invoke(obj, args);
- } catch (InvocationTargetException e) {
- throw e.getTargetException();
- } catch (Exception e) {
- throw new RuntimeException("unexpected invocation exception: " + e.getMessage());
- } finally {
- System.out.println("after invoking method " + m.getName());
+
+ public Object invoke(Object proxy, Method m, Object[] args) throws Throwable {
+ Object result;
+ if (obj == null) {
+ return null;
+ }
+ try {
+ System.out.println("before invoking method " + m.getName());
+ result = m.invoke(obj, args);
+ } catch (InvocationTargetException e) {
+ throw e.getTargetException();
+ } catch (Exception e) {
+ throw new RuntimeException("unexpected invocation exception: " + e.getMessage());
+ } finally {
+ System.out.println("after invoking method " + m.getName());
+ }
+ return result;
}
- return result;
- }
}
public class Main {
- public static void call(Foo foo) {
- if (foo == null) {
- return;
+ public static void call(Foo foo) {
+ if (foo == null) {
+ return;
+ }
+ foo.bar(null);
}
- foo.bar(null);
- }
- public static void main(String[] args) {
- System.loadLibrary(args[0]);
- Foo foo = (Foo)DebugProxy.newInstance(null);
- ensureJitCompiled(Main.class, "call");
- call(foo);
- }
+ public static void main(String[] args) {
+ System.loadLibrary(args[0]);
+ Foo foo = (Foo)DebugProxy.newInstance(null);
+ ensureJitCompiled(Main.class, "call");
+ call(foo);
+ }
- private static native void ensureJitCompiled(Class<?> itf, String method_name);
+ private static native void ensureJitCompiled(Class<?> itf, String method_name);
}