diff options
Diffstat (limited to 'test/044-proxy/src/BasicTest.java')
-rw-r--r-- | test/044-proxy/src/BasicTest.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/044-proxy/src/BasicTest.java b/test/044-proxy/src/BasicTest.java index d4ce71fa11..15732978aa 100644 --- a/test/044-proxy/src/BasicTest.java +++ b/test/044-proxy/src/BasicTest.java @@ -270,6 +270,20 @@ class MyInvocationHandler implements InvocationHandler { } } + if (method.getDeclaringClass() == Trace.class) { + if (method.getName().equals("getTrace")) { + StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); + for (int i = 0; i < stackTrace.length; i++) { + StackTraceElement ste = stackTrace[i]; + if (ste.getMethodName().equals("getTrace")) { + System.out.println(ste.getClassName() + "." + ste.getMethodName() + " " + + ste.getFileName() + ":" + ste.getLineNumber()); + } + } + return null; + } + } + System.out.println("Invoke " + method); if (args == null || args.length == 0) { System.out.println(" (no args)"); |