mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
project model: fix removing content entry (IDEA-195253)
If a ContentEntry is disposed its VirtualFilePointer may be disposed as well, and its 'getUrl' method will return "", so the ContentEntry won't be properly removed (because myContent uses comparator which compares entries via 'getUrl' method).
This commit is contained in:
@@ -239,12 +239,12 @@ public class RootModelImpl extends RootModelBase implements ModifiableRootModel
|
||||
public void removeContentEntry(@NotNull ContentEntry entry) {
|
||||
assertWritable();
|
||||
LOG.assertTrue(myContent.contains(entry));
|
||||
myContent.remove(entry);
|
||||
if (entry instanceof RootModelComponentBase) {
|
||||
Disposer.dispose((Disposable)entry);
|
||||
RootModelImpl entryModel = ((RootModelComponentBase)entry).getRootModel();
|
||||
LOG.assertTrue(entryModel == this, "Removing from " + this + " content entry obtained from " + entryModel);
|
||||
}
|
||||
myContent.remove(entry);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user