Program: 102203
Project: 102203
Buggy source:
@Override public RefactoringStatus checkFinalConditions(IProgressMonitor progressMonitor) throws OperationCanceledException {
  clearChanges();
  RefactoringStatus status=new RefactoringStatus();
  try {
    progressMonitor.beginTask(RefactorResourcesUtils.getString("String_Node_Str"),2);
    for (    IResource resource : getResources()) {
      addChange(resource,new RenameResourceChange(resource.getFullPath(),getNewResourceName()));
      IPath absPath=resource.getRawLocation().makeAbsolute();
      IPath destination=absPath.removeLastSegments(1).append(getNewResourceName());
      String destinationPath=destination.toOSString();
      PathPair pathPair=new PathPair(absPath.toOSString(),destinationPath);
      RelatedResourceCallback callback=new RelatedResourceCallback(pathPair);
      if (ModelUtil.isModelFile(resource)) {
        try {
          TextFileChange textFileChange=new TextFileChange(resource.getName(),(IFile)resource);
          RefactorResourcesUtils.calculateSQLChanges((IFile)resource,pathPair,textFileChange);
          addChange(resource,textFileChange);
          RefactorResourcesUtils.calculateRelatedVdbResources(resource,status,callback);
        }
 catch (        Exception ex) {
          UiConstants.Util.log(ex);
          status.merge(RefactoringStatus.createFatalErrorStatus(ex.getMessage()));
        }
      }
      RefactorResourcesUtils.calculateRelatedResources(resource,status,callback,Relationship.DEPENDENT);
    }
  }
  finally {
    progressMonitor.done();
  }
  return status;
}

Fixed version (ground truth):
@Override public RefactoringStatus checkFinalConditions(IProgressMonitor progressMonitor) throws OperationCanceledException {
  clearChanges();
  RefactoringStatus status=new RefactoringStatus();
  try {
    progressMonitor.beginTask(RefactorResourcesUtils.getString("String_Node_Str"),2);
    for (    IResource resource : getResources()) {
      addChange(resource,new RenameResourceChange(resource.getFullPath(),getNewResourceName()));
      IPath absPath=resource.getRawLocation().makeAbsolute();
      IPath destination=absPath.removeLastSegments(1).append(getNewResourceName());
      String destinationPath=destination.toOSString();
      PathPair pathPair=new PathPair(absPath.toOSString(),destinationPath);
      RelatedResourceCallback callback=new RelatedResourceCallback(pathPair);
      if (ModelUtil.isModelFile(resource)) {
        try {
          TextFileChange textFileChange=new TextFileChange(resource.getName(),(IFile)resource);
          RefactorResourcesUtils.calculateSQLChanges((IFile)resource,pathPair,textFileChange);
          if (textFileChange.getEdit() != null && textFileChange.getEdit().hasChildren()) {
            addChange(resource,textFileChange);
          }
          RefactorResourcesUtils.calculateRelatedVdbResources(resource,status,callback);
        }
 catch (        Exception ex) {
          UiConstants.Util.log(ex);
          status.merge(RefactoringStatus.createFatalErrorStatus(ex.getMessage()));
        }
      }
      RefactorResourcesUtils.calculateRelatedResources(resource,status,callback,Relationship.DEPENDENT);
    }
  }
  finally {
    progressMonitor.done();
  }
  return status;
}