mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoided storing detected library properties in the model
This commit is contained in:
+7
-2
@@ -36,6 +36,7 @@ public class ExistingLibraryEditor extends LibraryEditorBase implements Disposab
|
||||
private final LibraryEditorListener myListener;
|
||||
private String myLibraryName = null;
|
||||
private LibraryProperties myLibraryProperties;
|
||||
private LibraryProperties myDetectedLibraryProperties;
|
||||
private Library.ModifiableModel myModel = null;
|
||||
private LibraryType<?> myDetectedType;
|
||||
private boolean myDetectedTypeComputed;
|
||||
@@ -76,7 +77,7 @@ public class ExistingLibraryEditor extends LibraryEditorBase implements Disposab
|
||||
final Pair<LibraryType<?>,LibraryProperties<?>> pair = LibraryDetectionManager.getInstance().detectType(Arrays.asList(getFiles(OrderRootType.CLASSES)));
|
||||
if (pair != null) {
|
||||
myDetectedType = pair.getFirst();
|
||||
myLibraryProperties = pair.getSecond();
|
||||
myDetectedLibraryProperties = pair.getSecond();
|
||||
}
|
||||
myDetectedTypeComputed = true;
|
||||
}
|
||||
@@ -88,6 +89,10 @@ public class ExistingLibraryEditor extends LibraryEditorBase implements Disposab
|
||||
final LibraryType type = getType();
|
||||
if (type == null) return null;
|
||||
|
||||
if (myDetectedType != null) {
|
||||
return myDetectedLibraryProperties;
|
||||
}
|
||||
|
||||
if (myLibraryProperties == null) {
|
||||
myLibraryProperties = type.createDefaultProperties();
|
||||
//noinspection unchecked
|
||||
@@ -155,7 +160,7 @@ public class ExistingLibraryEditor extends LibraryEditorBase implements Disposab
|
||||
|
||||
@Override
|
||||
public void addJarDirectory(String url, boolean recursive, OrderRootType rootType) {
|
||||
getModel() .addJarDirectory(url, recursive, rootType);
|
||||
getModel().addJarDirectory(url, recursive, rootType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user