aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2011-07-27 09:42:51 -0700
committerAndroid Code Review <code-review@android.com>2011-07-27 09:42:51 -0700
commitcbf95cc623e631f044fab6260c84c45d2f79ba9a (patch)
tree016dab125a0f23a25b2a84cd2b5c7a847e796467
parent4acb7dd9a09af790eb019922f6e4bc8555c39cd6 (diff)
parent986561291b06f5283b447501f01ecece83dfae66 (diff)
downloadsdk-cbf95cc623e631f044fab6260c84c45d2f79ba9a.zip
sdk-cbf95cc623e631f044fab6260c84c45d2f79ba9a.tar.gz
sdk-cbf95cc623e631f044fab6260c84c45d2f79ba9a.tar.bz2
Merge "Fix 18539: "Extract Android String" mangles the replacement str"
-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;