aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java
index f2b9a55..8b2f729 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java
@@ -930,6 +930,8 @@ public class ExtractStringRefactoring extends Refactoring {
}
if (mReplaceAllJava) {
+ String currentIdentifier = mUnit != null ? mUnit.getHandleIdentifier() : ""; //$NON-NLS-1$
+
SubMonitor submon = SubMonitor.convert(monitor, 1);
for (ICompilationUnit unit : findAllJavaUnits()) {
// Only process Java compilation units that exist, are not derived
@@ -941,6 +943,13 @@ public class ExtractStringRefactoring extends Refactoring {
if (resource == null || resource.isDerived()) {
continue;
}
+
+ // Ensure that we don't process the current compilation unit (processed
+ // as mUnit above) twice
+ if (currentIdentifier.equals(unit.getHandleIdentifier())) {
+ continue;
+ }
+
ResourceAttributes attrs = resource.getResourceAttributes();
if (attrs != null && attrs.isReadOnly()) {
continue;