Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRenameProcessor.java5
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/RenameSupport.java8
2 files changed, 6 insertions, 7 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRenameProcessor.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRenameProcessor.java
index 2bb5bb1b09..408c225c99 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRenameProcessor.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/CRenameProcessor.java
@@ -42,8 +42,6 @@ import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICProject;
-import org.eclipse.cdt.internal.ui.refactoring.RefactoringSaveHelper;
-
/**
* This is the processor used for the rename. It decides which of the delegates to
* use and forwards further calls to the delegate.
@@ -334,9 +332,6 @@ public class CRenameProcessor extends RenameProcessor {
* @return a save mode from {@link org.eclipse.cdt.internal.ui.refactoring.RefactoringSaveHelper}
*/
public int getSaveMode() {
- if (fDelegate == null) {
- return RefactoringSaveHelper.SAVE_NOTHING;
- }
return fDelegate.getSaveMode();
}
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/RenameSupport.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/RenameSupport.java
index 061495f289..f54d36a7df 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/RenameSupport.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/refactoring/rename/RenameSupport.java
@@ -191,7 +191,11 @@ public class RenameSupport {
CRenameProcessor processor = (CRenameProcessor) refactoring.getProcessor();
processor.lockIndex();
try {
- processor.checkInitialConditions(new NullProgressMonitor());
+ RefactoringStatus status = processor.checkInitialConditions(new NullProgressMonitor());
+ if (status.hasFatalError()) {
+ showInformation(shell, status);
+ return DialogResult.CANCELED;
+ }
if (starter.activate(wizard, shell, RenameMessages.CRefactory_title_rename,
processor.getSaveMode())) {
return DialogResult.OK;
@@ -298,7 +302,7 @@ public class RenameSupport {
}
}
- private void showInformation(Shell parent, RefactoringStatus status) {
+ private static void showInformation(Shell parent, RefactoringStatus status) {
String message= status.getMessageMatchingSeverity(RefactoringStatus.FATAL);
MessageDialog.openInformation(parent, RenameMessages.RenameSupport_dialog_title, message);
}

Back to the top