void (@NotNull Collection<? extends IProperty> properties, @NotNull final String newName, @NotNull ResourceBundle targetResourceBundle) { final Map<IProperty, PropertiesFile> propertiesFileMapping = new HashMap<>(); for (IProperty property : properties) { final PropertiesFile containingFile = property.getPropertiesFile(); final PropertiesFile matched = findWithMatchedSuffix(containingFile, targetResourceBundle); if (matched != null) { propertiesFileMapping.put(property, matched); } } final Project project = targetResourceBundle.getProject(); if (properties.size() != propertiesFileMapping.size() && Messages.NO == Messages.showYesNoDialog(project, PropertiesBundle.message("copy.resource.bundles.are.not.matched.message"), PropertiesBundle.message("copy.resource.bundles.are.not.matched.title"), null)) { return; } if (!propertiesFileMapping.isEmpty()) { WriteCommandAction.runWriteCommandAction(project, () -> { if (!FileModificationService.getInstance().preparePsiElementsForWrite(ContainerUtil.map(propertiesFileMapping.values(), PropertiesFile::getContainingFile))) return; for (Map.Entry<IProperty, PropertiesFile> entry : propertiesFileMapping.entrySet()) { final String value = entry.getKey().getValue(); final PropertiesFile target = entry.getValue(); target.addProperty(newName, value); } }); final IProperty representativeFromSourceBundle = ContainerUtil.getFirstItem(properties); LOG.assertTrue(representativeFromSourceBundle != null); final ResourceBundle sourceResourceBundle = representativeFromSourceBundle.getPropertiesFile().getResourceBundle(); updateBundleEditors(newName, targetResourceBundle, sourceResourceBundle, project); } }