diff options
Diffstat (limited to 'test/044-proxy/src/BasicTest.java')
-rw-r--r-- | test/044-proxy/src/BasicTest.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/test/044-proxy/src/BasicTest.java b/test/044-proxy/src/BasicTest.java index ea46f49f2b..d4ce71fa11 100644 --- a/test/044-proxy/src/BasicTest.java +++ b/test/044-proxy/src/BasicTest.java @@ -90,6 +90,7 @@ public class BasicTest { Annotation[][] paramAnnos = meth.getParameterAnnotations(); System.out.println("Param annos (" + paramAnnos.length + ") : " + Arrays.deepToString(paramAnnos)); + System.out.println("Modifiers: " + meth.getModifiers()); } static Object createProxy(Object proxyMe) { @@ -244,14 +245,15 @@ class MyInvocationHandler implements InvocationHandler { // invocation of toString() in the print statements below. if (method.getDeclaringClass() == java.lang.Object.class) { //System.out.println("!!! object " + method.getName()); - if (method.getName().equals("toString")) + if (method.getName().equals("toString")) { return super.toString(); - else if (method.getName().equals("hashCode")) + } else if (method.getName().equals("hashCode")) { return Integer.valueOf(super.hashCode()); - else if (method.getName().equals("equals")) + } else if (method.getName().equals("equals")) { return Boolean.valueOf(super.equals(args[0])); - else + } else { throw new RuntimeException("huh?"); + } } if (method.getDeclaringClass() == Trace.class) { @@ -277,10 +279,11 @@ class MyInvocationHandler implements InvocationHandler { } try { - if (true) + if (true) { result = method.invoke(mObj, args); - else + } else { result = -1; + } System.out.println("Success: method " + method.getName() + " res=" + result); } catch (InvocationTargetException ite) { |