From 3a79d231f0590cdf06d0f4491fedfa7ff29d0d76 Mon Sep 17 00:00:00 2001 From: nik Date: Mon, 20 Nov 2017 18:03:16 +0300 Subject: [PATCH] project configuration: avoid infinite loops when deleting library root Avoid infinite loop even if 'Library.ModifiableModel::removeRoot' always returns true because of a bug (see IDEA-182159). If there are several identical roots in a library it should be ok to remove them one by one. --- .../configuration/libraryEditor/ExistingLibraryEditor.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/ExistingLibraryEditor.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/ExistingLibraryEditor.java index a45bcaedcdd3..50e6f64985fa 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/ExistingLibraryEditor.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/ExistingLibraryEditor.java @@ -189,11 +189,7 @@ public class ExistingLibraryEditor extends LibraryEditorBase implements Disposab @Override public void removeRoot(@NotNull String url, @NotNull OrderRootType rootType) { - boolean removed; - do { - removed = getModel().removeRoot(url, rootType); - } - while (removed); + getModel().removeRoot(url, rootType); } @Override