Problems with unload Resources and reloading them and working with a new EditingDomain [message #1060283] |
Thu, 23 May 2013 21:00 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03284 seconds