update grails project structure: remove proper instance of ContentEntry (IDEA-120622) using urls since ContentEntry uses default equals/hashcode implementation

This commit is contained in:
nik
2014-07-21 14:01:57 +04:00
parent 14d57e4209
commit a4cdd68058
@@ -356,11 +356,11 @@ public class MvcModuleStructureUtil {
private static void removeInvalidSourceRoots(List<Consumer<ModifiableRootModel>> actions, MvcProjectStructure structure) {
final Set<SourceFolder> toRemove = ContainerUtil.newTroveSet();
final Set<ContentEntry> toRemoveContent = ContainerUtil.newTroveSet();
final Set<String> toRemoveContent = ContainerUtil.newTroveSet();
for (ContentEntry entry : ModuleRootManager.getInstance(structure.myModule).getContentEntries()) {
final VirtualFile file = entry.getFile();
if (file == null || !structure.isValidContentRoot(file)) {
toRemoveContent.add(entry);
toRemoveContent.add(entry.getUrl());
}
else {
for (SourceFolder folder : entry.getSourceFolders()) {
@@ -376,7 +376,7 @@ public class MvcModuleStructureUtil {
@Override
public void consume(ModifiableRootModel model) {
for (ContentEntry entry : model.getContentEntries()) {
if (toRemoveContent.remove(entry)) {
if (toRemoveContent.remove(entry.getUrl())) {
model.removeContentEntry(entry);
}
else {