public static void deletePackage(IPackageFragment pack) throws CoreException {
  for (int i=0; i < MAX_RETRY; i++) {
    try {
      pack.delete(true,null);
      i=MAX_RETRY;
    }
 catch (    CoreException e) {
      if (i == MAX_RETRY - 1) {
        JavaPlugin.log(e);
        throw e;
      }
      try {
        JavaPlugin.log(new IllegalStateException("sleep before retrying JavaProjectHelper.delete() for package " + pack.getHandleIdentifier()));
        Thread.sleep(RETRY_DELAY);
      }
 catch (      InterruptedException e1) {
      }
    }
  }
}

public static void deletePackage ( IPackageFragment pack ) throws CoreException { for ( int i = 0 ; i < MAX_RETRY ; i ++ ) { try { pack . delete ( true , null ) ; i = MAX_RETRY ; } catch ( CoreException e ) { if ( i == MAX_RETRY - 1 ) { JavaPlugin . log ( e ) ; throw e ; } try { JavaPlugin . log ( new IllegalStateException ( "sleep before retrying JavaProjectHelper.delete() for package " + pack . getHandleIdentifier ( ) ) ) ; Thread . sleep ( RETRY_DELAY ) ; } catch ( InterruptedException e1 ) { } } } }
removes a package fragment . retries if deletion failed ( e . g . because the indexer still locks a file ) .
