boolean (@NotNull String oldName, @NotNull String newName) { List<TreeItem<Pair<AbstractUrl, String>>> list = myName2FavoritesRoots.remove(oldName); int index = myFavoritesRootsOrder.indexOf(oldName); if (index != -1 && newName.length() > 0) { myFavoritesRootsOrder.remove(oldName); myFavoritesRootsOrder.remove(newName); myFavoritesRootsOrder.add(index, newName); } if (list != null && newName.length() > 0) { myName2FavoritesRoots.put(newName, list); String description = myDescriptions.remove(oldName); if (description != null) { myDescriptions.put(newName, description); } rootsChanged(); return true; } return false; }