Program: 7048
Project: 7048
Buggy source:
/** 
 * Deletes all modules in a namespace, other than system. Presumes that the namespace has already been checked to be non-system.
 * @param namespaceId the {@link Id.Namespace} to delete modules from.
 */
public void deleteModules(final Id.Namespace namespaceId) throws DatasetModuleConflictException {
  Preconditions.checkArgument(namespaceId != null && !Constants.SYSTEM_NAMESPACE_ID.equals(namespaceId),"String_Node_Str");
  LOG.warn("String_Node_Str",namespaceId);
  try {
    mdsDatasets.execute(new TxCallable<MDSDatasets,Void>(){
      @Override public Void call(      MDSDatasets datasets) throws DatasetModuleConflictException {
        Set<String> typesToDelete=Sets.newHashSet();
        for (        DatasetModuleMeta module : datasets.getTypeMDS().getModules(namespaceId)) {
          typesToDelete.addAll(module.getTypes());
        }
        Collection<DatasetSpecification> dependentInstances=datasets.getInstanceMDS().getByTypes(namespaceId,typesToDelete);
        if (dependentInstances.size() > 0) {
          String msg=String.format("String_Node_Str");
          throw new DatasetModuleConflictException(msg);
        }
        datasets.getTypeMDS().deleteModules(namespaceId);
        return null;
      }
    }
);
  }
 catch (  TransactionFailureException e) {
    if (e.getCause() != null && e.getCause() instanceof DatasetModuleConflictException) {
      throw (DatasetModuleConflictException)e.getCause();
    }
    LOG.error("String_Node_Str",namespaceId);
    throw Throwables.propagate(e);
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
/** 
 * Deletes all modules in a namespace, other than system. Presumes that the namespace has already been checked to be non-system.
 * @param namespaceId the {@link Id.Namespace} to delete modules from.
 */
public void deleteModules(final Id.Namespace namespaceId) throws DatasetModuleConflictException {
  Preconditions.checkArgument(namespaceId != null && !Constants.SYSTEM_NAMESPACE_ID.equals(namespaceId),"String_Node_Str");
  LOG.warn("String_Node_Str",namespaceId);
  try {
    mdsDatasets.execute(new TxCallable<MDSDatasets,Void>(){
      @Override public Void call(      MDSDatasets datasets) throws DatasetModuleConflictException, IOException {
        Set<String> typesToDelete=Sets.newHashSet();
        List<Location> moduleLocations=Lists.newArrayList();
        for (        DatasetModuleMeta module : datasets.getTypeMDS().getModules(namespaceId)) {
          typesToDelete.addAll(module.getTypes());
          moduleLocations.add(locationFactory.create(module.getJarLocation()));
        }
        Collection<DatasetSpecification> dependentInstances=datasets.getInstanceMDS().getByTypes(namespaceId,typesToDelete);
        if (dependentInstances.size() > 0) {
          String msg=String.format("String_Node_Str");
          throw new DatasetModuleConflictException(msg);
        }
        datasets.getTypeMDS().deleteModules(namespaceId);
        for (        Location moduleLocation : moduleLocations) {
          if (!moduleLocation.delete()) {
            LOG.debug("String_Node_Str" + moduleLocation.toURI().getPath());
          }
        }
        return null;
      }
    }
);
  }
 catch (  TransactionFailureException e) {
    if (e.getCause() != null && e.getCause() instanceof DatasetModuleConflictException) {
      throw (DatasetModuleConflictException)e.getCause();
    }
    LOG.error("String_Node_Str",namespaceId);
    throw Throwables.propagate(e);
  }
catch (  Exception e) {
    LOG.error("String_Node_Str",e);
    throw Throwables.propagate(e);
  }
}