IDEA-61878 do not promote "rename alternate resources" if drawable resource is rename...
authorEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Fri, 26 Nov 2010 17:01:22 +0000 (20:01 +0300)
committerEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Fri, 26 Nov 2010 17:01:22 +0000 (20:01 +0300)
plugins/android/src/org/jetbrains/android/AndroidRenameResourceProcessor.java

index 367674cf79903eb7ebefab697d6aa186577e119f..084e1803fb18937e7442248dc8b9f9ab66aa7f3a 100644 (file)
@@ -201,6 +201,11 @@ public class AndroidRenameResourceProcessor extends RenamePsiElementProcessor {
     String type = manager.getFileResourceType(file);
     if (type == null) return;
     String name = file.getName();
+
+    if (ResourceManager.getResourceName(type, name).equals(ResourceManager.getResourceName(type, newName))) {
+      return;
+    }
+
     List<PsiFile> resourceFiles = manager.findResourceFiles(type, ResourceManager.getResourceName(type, name));
     List<PsiFile> alternativeResources = new ArrayList<PsiFile>();
     for (PsiFile resourceFile : resourceFiles) {