summaryrefslogtreecommitdiff
path: root/plugins/properties/src/com/intellij/lang/properties/refactoring/rename
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/properties/src/com/intellij/lang/properties/refactoring/rename')
-rw-r--r--plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java2
-rw-r--r--plugins/properties/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenamer.java9
2 files changed, 7 insertions, 4 deletions
diff --git a/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java b/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java
index f3c81736673f..6f0d52f1c294 100644
--- a/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java
+++ b/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java
@@ -46,7 +46,7 @@ public class RenamePropertyProcessor extends RenamePsiElementProcessor {
allRenames.clear();
for (final Map.Entry<PsiElement, String> e : allRenamesCopy.entrySet()) {
final IProperty property = (IProperty) e.getKey();
- final List<IProperty> properties = PropertiesUtil.findAllProperties(project, resourceBundle, property.getUnescapedKey());
+ final List<IProperty> properties = PropertiesUtil.findAllProperties(resourceBundle, property.getUnescapedKey());
for (final IProperty toRename : properties) {
allRenames.put(toRename.getPsiElement(), e.getValue());
}
diff --git a/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenamer.java b/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenamer.java
index ab1b4391b0f6..000f72ef5ae3 100644
--- a/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenamer.java
+++ b/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleRenamer.java
@@ -16,7 +16,7 @@
package com.intellij.lang.properties.refactoring.rename;
import com.intellij.lang.properties.PropertiesBundle;
-import com.intellij.lang.properties.PropertiesUtil;
+import com.intellij.lang.properties.ResourceBundleManager;
import com.intellij.lang.properties.psi.PropertiesFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiNamedElement;
@@ -28,7 +28,10 @@ import org.jetbrains.annotations.NonNls;
*/
public class ResourceBundleRenamer extends AutomaticRenamer {
+ private final ResourceBundleManager myResourceBundleManager;
+
public ResourceBundleRenamer(final PropertiesFile propertiesFile, final String newName) {
+ myResourceBundleManager = ResourceBundleManager.getInstance(propertiesFile.getProject());
for (final PropertiesFile file : propertiesFile.getResourceBundle().getPropertiesFiles()) {
if (file.equals(propertiesFile)) {
continue;
@@ -41,12 +44,12 @@ public class ResourceBundleRenamer extends AutomaticRenamer {
@Override
protected String nameToCanonicalName(@NonNls final String name, final PsiNamedElement element) {
- return PropertiesUtil.getBaseName((PsiFile)element);
+ return myResourceBundleManager.getBaseName((PsiFile)element);
}
@Override
protected String canonicalNameToName(@NonNls final String canonicalName, final PsiNamedElement element) {
- final String oldCanonicalName = PropertiesUtil.getBaseName((PsiFile)element);
+ final String oldCanonicalName = myResourceBundleManager.getBaseName((PsiFile)element);
final String oldName = element.getName();
assert oldName != null;
return canonicalName + oldName.substring(oldCanonicalName.length());