protected void applyRenameRefactoring(RefactoringRequest request, boolean expectError) throws CoreException {
PyRenameEntryPoint processor = new PyRenameEntryPoint(request);
NullProgressMonitor nullProgressMonitor = new NullProgressMonitor();
checkStatus(processor.checkInitialConditions(nullProgressMonitor), expectError);
checkStatus(processor.checkFinalConditions(nullProgressMonitor, null), expectError);
Change change = processor.createChange(nullProgressMonitor);
if (!expectError) {
//otherwise, if there is an error, the change may be null
change.perform(nullProgressMonitor);
}
}