public void compact(){
  ConstPool cp=compact0();
  ArrayList list=methods;
  int n=list.size();
  for (int i=0; i < n; ++i) {
    MethodInfo minfo=(MethodInfo)list.get(i);
    minfo.compact(cp);
  }
  list=fields;
  n=list.size();
  for (int i=0; i < n; ++i) {
    FieldInfo finfo=(FieldInfo)list.get(i);
    finfo.compact(cp);
  }
  attributes=AttributeInfo.copyAll(attributes,cp);
  constPool=cp;
}

public void compact ( ) { ConstPool cp = compact0 ( ) ; ArrayList list = methods ; int n = list . size ( ) ; for ( int i = 0 ; i < n ; ++ i ) { MethodInfo minfo = ( MethodInfo ) list . get ( i ) ; minfo . compact ( cp ) ; } list = fields ; n = list . size ( ) ; for ( int i = 0 ; i < n ; ++ i ) { FieldInfo finfo = ( FieldInfo ) list . get ( i ) ; finfo . compact ( cp ) ; } attributes = AttributeInfo . copyAll ( attributes , cp ) ; constPool = cp ; }
eliminates dead constant pool items . if a method or a field is removed , the constant pool items used by that method / field become dead items . this method recreates a constant pool .
