Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [epsilon-dev] NPE in InMemoryEmfModel

Hello,

AbstractModel already has a field to store a/the registry, so by using its 
getPackageRegistry() method everything works ok.

Without a ResourceSet the Resource creation factory does not make sense (as it 
requires a ResourceSet to create/store multiple Resources), so this could be 
easily skipped.

Therefore some null-checks were enough to support 'standalone resources' in 
InMemoryEmfModel.

I have committed these and everything should be working as it was (besides the 
new support for the 'standalone resources').

Cheers,
  Maarten

On Wednesday 05 February 2014 09:24:47 Dimitris Kolovos wrote:
> Hi Maarten,
> 
> When there's no resource set associated with the resource, we should
> indeed be keeping the provided ePackages in a different package
> registry. One option would be to introduce a local one and then
> override AbstractModel's getPackageRegistry().
> 
> Cheers,
> Dimitris
> 
> On 4 February 2014 12:21, Maarten Bezemer <maarten.bezemer@xxxxxxxxx> wrote:
> > Hello,
> > 
> > I stumbled upon an NPE when InMemoryEmfModel is used for resources that
> > are
> > not part of a ResourceSet.
> > 
> > The init() method, assumes there is a ResourceSet and uses it to register
> > EPackage instances. It is fairly easy to check if there is a ResourceSet
> > before registering the packages.
> > 
> > But, this would result in the packages not being registered when there is
> > no ResourceSet. I do not know whether this becomes a problem later or
> > not...
> > 
> > So before changing the behaviour of the init() method (and disabling
> > registering the packages when there is no ResourceSet), I was wondering
> > about your thoughts on this matter.
> > 
> > Cheers,
> > 
> >   Maarten
> > 
> > _______________________________________________
> > epsilon-dev mailing list
> > epsilon-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/epsilon-dev



Back to the top