From 0686d6b54b4d6ab301f13c908200a7ac91504d62 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Wed, 13 Mar 2013 18:53:39 +0100 Subject: [PATCH] ident java --- .../org/jnius/NativeInvocationHandler.java | 70 ++++++++----------- 1 file changed, 30 insertions(+), 40 deletions(-) diff --git a/jnius/src/org/jnius/NativeInvocationHandler.java b/jnius/src/org/jnius/NativeInvocationHandler.java index 0dda15f..ad6ca6d 100644 --- a/jnius/src/org/jnius/NativeInvocationHandler.java +++ b/jnius/src/org/jnius/NativeInvocationHandler.java @@ -3,47 +3,37 @@ import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; public class NativeInvocationHandler implements InvocationHandler { - public NativeInvocationHandler(long ptr) { - this.ptr = ptr; - } + public NativeInvocationHandler(long ptr) { + this.ptr = ptr; + } - public Object invoke(Object proxy, Method method, Object[] args) { - /** - if ( method.getName() == "toString" ) { - System.out.println("+ java:invoke toString."); - return ""; - } - /**/ - System.out.print("+ java:invoke(, "); - // don't call it, or recursive lookup/proxy will go! - //System.out.print(proxy); - //System.out.print(", "); - System.out.print(method); - System.out.print(", "); - System.out.print(args); - System.out.println(")"); - /** - if ( args != null ) { - for ( int i = 0; i < args.length; i++ ) { - System.out.print(" - arg"); - System.out.print(i); - System.out.print(","); - System.out.print(args[i].getClass()); - System.out.print(": "); - System.out.println(args[i]); - } - } - **/ - //System.out.println(method.getParameterTypes()); - //System.out.print("+ java:call native invoke0() >>>"); - Object ret = invoke0(proxy, method, args); - //System.out.println("+ java:call native invoke0() <<<"); - System.out.print("+ java:invoke returned: "); - System.out.println(ret); - return ret; - } + public Object invoke(Object proxy, Method method, Object[] args) { + /** + if ( method.getName() == "toString" ) { + System.out.println("+ java:invoke toString."); + return ""; + } + /**/ + System.out.print("+ java:invoke(, "); + // don't call it, or recursive lookup/proxy will go! + //System.out.print(proxy); + //System.out.print(", "); + System.out.print(method); + System.out.print(", "); + System.out.print(args); + System.out.println(")"); + System.out.flush(); - native Object invoke0(Object proxy, Method method, Object[] args); + //System.out.print("+ java:call native invoke0() >>>"); + Object ret = invoke0(proxy, method, args); + //System.out.println("+ java:call native invoke0() <<<"); - private long ptr; + System.out.print("+ java:invoke returned: "); + System.out.println(ret); + return ret; + } + + native Object invoke0(Object proxy, Method method, Object[] args); + + private long ptr; }