public static DalvInsnList makeImmutable(ArrayList<DalvInsn> list,int regCount){
  int size=list.size();
  DalvInsnList result=new DalvInsnList(size,regCount);
  for (int i=0; i < size; i++) {
    result.set(i,list.get(i));
  }
  result.setImmutable();
  return result;
}

public static DalvInsnList makeImmutable ( ArrayList < DalvInsn > list , int regCount ) { int size = list . size ( ) ; DalvInsnList result = new DalvInsnList ( size , regCount ) ; for ( int i = 0 ; i < size ; i ++ ) { result . set ( i , list . get ( i ) ) ; } result . setImmutable ( ) ; return result ; }
constructs and returns an immutable instance whose elements are identical to the ones in the given list , in the same order .
