Bug 67726 Refactoring fails if validate edit returns a cancel status [refactoring]
org.eclipse.ltk.core.refactoring/src/org/eclipse/ltk/internal/core/refactoring/Changes.java
public static RefactoringStatus validateModifiesFiles(IFile[] filesToModify) {
		RefactoringStatus result= new RefactoringStatus();
		IStatus status= Resources.checkInSync(filesToModify);
		if (!status.isOK())
			result.merge(RefactoringStatus.create(status));
		status= Resources.makeCommittable(filesToModify, null);
		if (!status.isOK())
			result.merge(RefactoringStatus.create(status));
		return result;
	}
	
	public static CoreException asCoreException(BadLocationException e) {
		String message= e.getMessage();
		if (message == null)
			message= "BadLocationException"; 
		return new CoreException(new Status(IStatus.ERROR, RefactoringCorePlugin.getPluginId(), IRefactoringCoreStatusCodes.BAD_LOCATION, message, e));
	}
}