changeset 7820:94ec81ddd4ec

8071999: SA's buildreplayjars fail with exception Summary: support default methods when dumping classes in SA Reviewed-by: vlivanov, kvn, dsamersoff
author roland
date Fri, 06 Feb 2015 13:50:44 +0100
parents 122b9c0f6a86
children e9291d20ecaa
files agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java	Fri Jan 30 15:23:41 2015 +0100
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java	Fri Feb 06 13:50:44 2015 +0100
@@ -423,12 +423,22 @@
 
     protected void writeMethods() throws IOException {
         MethodArray methods = klass.getMethods();
-        final int len = methods.length();
+        ArrayList<Method> valid_methods = new ArrayList<Method>();
+        for (int i = 0; i < methods.length(); i++) {
+            Method m = methods.at(i);
+            long accessFlags = m.getAccessFlags();
+            // overpass method
+            if (accessFlags == (JVM_ACC_PUBLIC | JVM_ACC_SYNTHETIC | JVM_ACC_BRIDGE)) {
+                continue;
+            }
+            valid_methods.add(m);
+        }
+        final int len = valid_methods.size();
         // write number of methods
         dos.writeShort((short) len);
         if (DEBUG) debugMessage("number of methods = " + len);
         for (int m = 0; m < len; m++) {
-            writeMethod(methods.at(m));
+            writeMethod(valid_methods.get(m));
         }
     }