Community
Participate
Working Groups
From http://www.eclipse.org/forums/index.php?t=rview&goto=1060283#msg_1060283 Hello, i have some trouble when i am unloading resources and loading new resources (or reloading the same resources) afterwards with the same EditingDomain. I have a TreeViewer that shows the ReqIf10 Model (the content of of the ResourceSet of an AdapterFactoryEditingDomain) - just as a generated EMF-Editor. As long as i am not unloading Resources, everything works fine. But when i unload Resources and load new Resources with the same EditingDomain, a NullPointerExceptions occurs: java.lang.NullPointerException at org.eclipse.rmf.reqif10.pror.util.ProrUtil.collectNewChildDescriptorsForTypeCreators(ProrUtil.java:256) at org.eclipse.rmf.reqif10.pror.provider.VirtualSpecificationsItemProvider.collectNewChildDescriptors(VirtualSpecificationsItemProvider.java:79) at org.eclipse.emf.edit.provider.ItemProviderAdapter.getNewChildDescriptors(ItemProviderAdapter.java:785) at org.eclipse.rmf.reqif10.pror.provider.TransientReqIFItemProvider.getNewChildDescriptors(TransientReqIFItemProvider.java:68) at org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.getNewChildDescriptors(AdapterFactoryEditingDomain.java:743) I already tried to always create a new EditingDomain when I want to open another Resource. But this results in another NullPointerException when the selectionChanged operations of Delete/Copy/Cut/Paste Actions are called: java.lang.NullPointerException at org.eclipse.rmf.reqif10.pror.provider.ReqIFContentItemProvider.getVirtualSpecifications(ReqIFContentItemProvider.java:223) at org.eclipse.rmf.reqif10.pror.provider.SpecificationItemProvider.getParent(SpecificationItemProvider.java:283) at org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.getParent(AdapterFactoryEditingDomain.java:621) at org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain.createCommand(AdapterFactoryEditingDomain.java:488) at org.eclipse.emf.edit.command.RemoveCommand.create(RemoveCommand.java:93) I cann see that the call "// getChildren(object);" is commented out in the operation getVirtualSpecifications. This call could avoid that NullPointerException. Is there a reason why this is commented out? Best regards Arne