Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Requirements Modeling Framework  » Problems with unload Resources and reloading them and working with a new EditingDomain
Problems with unload Resources and reloading them and working with a new EditingDomain [message #1060283] Thu, 23 May 2013 21:00 Go to next message
Eclipse UserFriend
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
Re: Problems with unload Resources and reloading them and working with a new EditingDomain [message #1060386 is a reply to message #1060283] Fri, 24 May 2013 11:49 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

i have solved the second issue when working with a new EditingDomain. I
have made a mistake in my Code regaring updating my Actions.

But i think there is a problem with the Plugin
org.eclipse.rmf.reqif10.pror.edit when working with different resources
on the same EditingDomain. The Problem seems to be related to the
virtual nodes (from the Content Provider).

Best regards

Arne

Am 23.05.2013 23:00, schrieb Arne Noyer:
> 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
Re: Problems with unload Resources and reloading them and working with a new EditingDomain [message #1060714 is a reply to message #1060386] Tue, 28 May 2013 08:18 Go to previous message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hi Arne,

I am glad you could resolve your problem. As far as the virtual nodes are concerned, we should look into it. I created a Bugzilla entry: https://bugs.eclipse.org/bugs/show_bug.cgi?id=409249

Best,

- Michael
Previous Topic:easy way to export / print reqs including link information
Next Topic:Clarification on Spec hierachy
Goto Forum:
  


Current Time: Tue Mar 19 11:45:13 GMT 2024

Powered by FUDForum. Page generated in 0.02548 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top