Bug 409249 - NPE from virtual node in some circumstances
Summary: NPE from virtual node in some circumstances
Status: NEW
Alias: None
Product: MDT.RMF
Classification: Modeling
Component: ProR (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Michael Jastram CLA
QA Contact: Michael Jastram CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-28 04:17 EDT by Michael Jastram CLA
Modified: 2013-05-28 04:17 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Jastram CLA 2013-05-28 04:17:25 EDT
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