mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add logging to investigate EA-88298 - assert: RootModelImpl.addLibraryEntry
This commit is contained in:
@@ -33,6 +33,7 @@ import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jdom.Element;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -225,7 +226,14 @@ public class RootModelImpl extends RootModelBase implements ModifiableRootModel
|
||||
public LibraryOrderEntry addLibraryEntry(@NotNull Library library) {
|
||||
assertWritable();
|
||||
final LibraryOrderEntry libraryOrderEntry = new LibraryOrderEntryImpl(library, this, myProjectRootManager);
|
||||
assert libraryOrderEntry.isValid();
|
||||
if (libraryOrderEntry.isValid()) {
|
||||
LibraryEx libraryEx = ObjectUtils.tryCast(library, LibraryEx.class);
|
||||
boolean libraryDisposed = libraryEx != null ? libraryEx.isDisposed() : Disposer.isDisposed(library);
|
||||
throw new AssertionError("Invalid libraryOrderEntry, library: " + library
|
||||
+ " of type " + library.getClass()
|
||||
+ ", disposed: " + libraryDisposed
|
||||
+ ", kind: " + (libraryEx != null ? libraryEx.getKind() : "<undefined>"));
|
||||
}
|
||||
myOrderEntries.add(libraryOrderEntry);
|
||||
return libraryOrderEntry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user