diff options
author | Brian Carlstrom <bdc@google.com> | 2014-03-12 08:42:34 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2014-03-12 08:47:16 -0700 |
commit | 4460ea6b35d81fd8a5ad531fb13b506206476b95 (patch) | |
tree | d6a37c1302021c4bdd280cb2164df922eb838ad5 /test/044-proxy/src/BasicTest.java | |
parent | 37d4c1db4d705f5a28001f65afdd68d0527948d8 (diff) |
Test Method.getModifiers() result for proxy methods
Change-Id: I2ba3be80ea21c5cfc0e2b9463270e34622c8c92b
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) { |