summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoopur Gupta2013-02-21 08:33:53 (EST)
committer Dani Megert2013-02-21 08:33:53 (EST)
commite6cca01f9de9b59c2f34a2f94a8dcc4f7276008b (patch)
tree87bf23f2b44c7f5b60b292ec4bfe3649e6693b86
parent43598399868daddfd1594f4d8d21c79c2a2a8f23 (diff)
downloadeclipse.jdt.ui-e6cca01f9de9b59c2f34a2f94a8dcc4f7276008b.zip
eclipse.jdt.ui-e6cca01f9de9b59c2f34a2f94a8dcc4f7276008b.tar.gz
eclipse.jdt.ui-e6cca01f9de9b59c2f34a2f94a8dcc4f7276008b.tar.bz2
Fixed bug 394530: [convert local] Convert local creates duplicate field
name
-rw-r--r--org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PromoteTempWizard.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PromoteTempWizard.java b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PromoteTempWizard.java
index 1fa846b..7e5c755 100644
--- a/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PromoteTempWizard.java
+++ b/org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/PromoteTempWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -102,9 +102,11 @@ public class PromoteTempWizard extends RefactoringWizard {
nameLabel.setLayoutData(new GridData());
String[] guessedFieldNames= getPromoteTempRefactoring().guessFieldNames();
+ String firstGuessedFieldName= guessedFieldNames[0];
fNameField = new Text(result, SWT.BORDER | SWT.SINGLE);
- fNameField.setText(guessedFieldNames[0]);
+ fNameField.setText(firstGuessedFieldName);
+ getPromoteTempRefactoring().setFieldName(firstGuessedFieldName);
fNameField.selectAll();
fNameField.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fNameField.addModifyListener(new ModifyListener(){