/** @return deep copy of this attribute */
  public Attribute copy(ConstantPool constant_pool) {
    InnerClasses c = (InnerClasses) clone();

    c.inner_classes = new InnerClass[number_of_classes];
    for (int i = 0; i < number_of_classes; i++) c.inner_classes[i] = inner_classes[i].copy();

    c.constant_pool = constant_pool;
    return c;
  }
Example #2
0
 public Attribute createAttribute(DataInputStream in, String name, int nameIndex, int length)
     throws IOException {
   if (name.equals("InnerClasses")) {
     innerClasses = new InnerClasses(in, nameIndex, length);
     Info[] allInnerInfos = innerClasses.getClasses();
     for (int i = 0; i < allInnerInfos.length; i++) {
       if (allInnerInfos[i].classIndex == getThisClass()) {
         innerClassInfo = allInnerInfos[i];
       }
     }
     return innerClasses;
   }
   if (name.equals("Signature")) {
     signature = new Signature(this, in, nameIndex, length);
     return signature;
   }
   return null;
 }
 /**
  * Initialize from another object. Note that both objects use the same references (shallow copy).
  * Use clone() for a physical copy.
  */
 public InnerClasses(InnerClasses c) {
   this(c.getNameIndex(), c.getLength(), c.getInnerClasses(), c.getConstantPool());
 }