test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java
changeset 50735 2f2af62dfac7
parent 48826 c4d9d1b08e2e
child 52403 89c73c4b1efe
equal deleted inserted replaced
50734:0828a0f6676b 50735:2f2af62dfac7
     1 /*
     1 /*
     2  * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    83 import com.sun.tools.classfile.ModuleHashes_attribute.Entry;
    83 import com.sun.tools.classfile.ModuleHashes_attribute.Entry;
    84 import com.sun.tools.classfile.ModuleMainClass_attribute;
    84 import com.sun.tools.classfile.ModuleMainClass_attribute;
    85 import com.sun.tools.classfile.ModuleResolution_attribute;
    85 import com.sun.tools.classfile.ModuleResolution_attribute;
    86 import com.sun.tools.classfile.ModuleTarget_attribute;
    86 import com.sun.tools.classfile.ModuleTarget_attribute;
    87 import com.sun.tools.classfile.ModulePackages_attribute;
    87 import com.sun.tools.classfile.ModulePackages_attribute;
       
    88 import com.sun.tools.classfile.NestHost_attribute;
       
    89 import com.sun.tools.classfile.NestMembers_attribute;
    88 import com.sun.tools.classfile.Opcode;
    90 import com.sun.tools.classfile.Opcode;
    89 import com.sun.tools.classfile.RuntimeInvisibleAnnotations_attribute;
    91 import com.sun.tools.classfile.RuntimeInvisibleAnnotations_attribute;
    90 import com.sun.tools.classfile.RuntimeInvisibleParameterAnnotations_attribute;
    92 import com.sun.tools.classfile.RuntimeInvisibleParameterAnnotations_attribute;
    91 import com.sun.tools.classfile.RuntimeInvisibleTypeAnnotations_attribute;
    93 import com.sun.tools.classfile.RuntimeInvisibleTypeAnnotations_attribute;
    92 import com.sun.tools.classfile.RuntimeVisibleAnnotations_attribute;
    94 import com.sun.tools.classfile.RuntimeVisibleAnnotations_attribute;
  1562     public Element visitModuleTarget(ModuleTarget_attribute attr, Element p) {
  1564     public Element visitModuleTarget(ModuleTarget_attribute attr, Element p) {
  1563         Element e = new Element(x.getCpString(attr.attribute_name_index));
  1565         Element e = new Element(x.getCpString(attr.attribute_name_index));
  1564         e.add(x.getCpString(attr.target_platform_index));
  1566         e.add(x.getCpString(attr.target_platform_index));
  1565         e.trimToSize();
  1567         e.trimToSize();
  1566         p.add(e);
  1568         p.add(e);
       
  1569         return null;
       
  1570     }
       
  1571 
       
  1572     @Override
       
  1573     public Element visitNestHost(NestHost_attribute attr, Element p) {
       
  1574         String aname = x.getCpString(attr.attribute_name_index);
       
  1575         String hname = x.getCpString(attr.top_index);
       
  1576         Element se = new Element(aname);
       
  1577         se.add(hname);
       
  1578         se.trimToSize();
       
  1579         p.add(se);
       
  1580         return null;
       
  1581     }
       
  1582 
       
  1583     @Override
       
  1584     public Element visitNestMembers(NestMembers_attribute attr, Element p) {
       
  1585         Element ee = new Element(x.getCpString(attr.attribute_name_index));
       
  1586         for (int idx : attr.members_indexes) {
       
  1587             Element n = new Element("Item");
       
  1588             n.setAttr("class", x.getCpString(idx));
       
  1589             ee.add(n);
       
  1590         }
       
  1591         ee.trimToSize();
       
  1592         p.add(ee);
  1567         return null;
  1593         return null;
  1568     }
  1594     }
  1569 }
  1595 }
  1570 
  1596 
  1571 class StackMapVisitor implements StackMapTable_attribute.stack_map_frame.Visitor<Element, Void> {
  1597 class StackMapVisitor implements StackMapTable_attribute.stack_map_frame.Visitor<Element, Void> {