diff options
| author | 2022-11-14 12:50:22 +0000 | |
|---|---|---|
| committer | 2022-11-14 15:16:19 +0000 | |
| commit | 31ad1d85cf9b512737092807626c9e904957759b (patch) | |
| tree | d52ae1ef8af5f7090227cd44d36c3f582d90c904 /test/616-cha-proxy-method-inline/src/Main.java | |
| parent | f07e4aac9583cb95d7b34a121aa8146be7c040ed (diff) | |
ART: Change indentation to 4 spaces in run-test shard 16.
Created with
for testName in \
`git grep -E '^ public static void main\(String\[\]' \
-- test/*16-*/src/Main.java | \
sed '-es/\/src\/Main.java:.*//'`; \
do \
find $testName/ -type f -name *.java | \
xargs sed -E '-es/^(( )+)/\1\1/' --in-place ; \
done
Manually edited long lines found with
git log -n1 -p | grep -E '^\+.{101}'
in test/916-obsolete-jit/src/Main.java .
Test: buildbot-build.sh --target
Change-Id: I096e06729554bfa010efdcc7c510690269cd3a53
Diffstat (limited to 'test/616-cha-proxy-method-inline/src/Main.java')
| -rw-r--r-- | test/616-cha-proxy-method-inline/src/Main.java | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/test/616-cha-proxy-method-inline/src/Main.java b/test/616-cha-proxy-method-inline/src/Main.java index be7bc820b3..10adc209e1 100644 --- a/test/616-cha-proxy-method-inline/src/Main.java +++ b/test/616-cha-proxy-method-inline/src/Main.java @@ -18,53 +18,53 @@ 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); } |