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 7e4b7721619e..d33dbb50f2d1 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 @@ -71,10 +71,13 @@ public class ExistingLibraryEditor extends LibraryEditorBase implements Disposab private LibraryType detectType() { if (!myDetectedTypeComputed) { - final Pair,LibraryProperties> pair = LibraryDetectionManager.getInstance().detectType(Arrays.asList(getFiles(OrderRootType.CLASSES))); - if (pair != null) { - myDetectedType = pair.getFirst(); - myDetectedLibraryProperties = pair.getSecond(); + LibraryTable libraryTable = myLibrary.getTable(); + if (libraryTable == null || libraryTable.isEditable()) { + final Pair,LibraryProperties> pair = LibraryDetectionManager.getInstance().detectType(Arrays.asList(getFiles(OrderRootType.CLASSES))); + if (pair != null) { + myDetectedType = pair.getFirst(); + myDetectedLibraryProperties = pair.getSecond(); + } } myDetectedTypeComputed = true; }