test/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -51,10 +51,11 @@
 import com.sun.tools.classfile.Instruction.TypeKind;
 import com.sun.tools.classfile.LineNumberTable_attribute;
 import com.sun.tools.classfile.LocalVariableTable_attribute;
 import com.sun.tools.classfile.LocalVariableTypeTable_attribute;
 import com.sun.tools.classfile.Method;
+import com.sun.tools.classfile.MethodParameters_attribute;
 import com.sun.tools.classfile.Opcode;
 import com.sun.tools.classfile.RuntimeInvisibleAnnotations_attribute;
 import com.sun.tools.classfile.RuntimeInvisibleParameterAnnotations_attribute;
 import com.sun.tools.classfile.RuntimeVisibleAnnotations_attribute;
 import com.sun.tools.classfile.RuntimeVisibleParameterAnnotations_attribute;

@@ -1067,10 +1068,23 @@
             l.setAttr("name", x.getCpString(e.name_index));
             l.setAttr("type", x.getCpString(e.signature_index));
             l.setAttr("slot", "" + e.index);
             l.trimToSize();
             p.add(l);
+        }
+        return null; // already added to parent
+    }
+
+    @Override
+    public Element visitMethodParameters(MethodParameters_attribute mp, Element p) {
+        String name = x.getCpString(mp.attribute_name_index);
+        for (MethodParameters_attribute.Entry e : mp.method_parameter_table) {
+            Element l = new Element(name);
+            l.setAttr("name", x.getCpString(e.name_index));
+            l.setAttr("flag", "" + e.flags);
+            l.trimToSize();
+            p.add(l);
         }
         return null; // already added to parent
     }
 
     private void parseAnnotations(Annotation[] ra, Element p) {