question: 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 ; }
target:  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.