Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EmfMetamodel disposal
EmfMetamodel disposal [message #1802263] Tue, 05 February 2019 14:20 Go to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hello!

I have been implementing the extended version of emf2uml profile generation, I've ran into some problem with the EmfMetamodel

I loaded the EmfMetamodel with the metamodel uri and the loading is OK, but when the model is disposed, a NPE is thrown on the disposeModel() method of AbstractEmfModel - the resourceSet of the model is null.

Any ideas?

P.S. the link to the line of code that causes the problem is in [1].

Cheers!
Will

[1]. https://github.com/wrwei/Jorvik/blob/master/org.eclipse.jorvik.oxygen/src/profile/generation/util/UtilityMethods.java#L169


Research Associate
Department of Computer Science
University of York

[Updated on: Tue, 05 February 2019 18:53]

Report message to a moderator

Re: EmfMetamodel disposal [message #1802353 is a reply to message #1802263] Thu, 07 February 2019 09:27 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi Will,

This appears to have been fixed in the latest interim version, which now checks that the resource set is not null (see line 390 of https://git.eclipse.org/c/epsilon/org.eclipse.epsilon.git/tree/plugins/org.eclipse.epsilon.emc.emf/src/org/eclipse/epsilon/emc/emf/AbstractEmfModel.java). Could you please try this version and let me know if the problem persists?

Cheers,
Dimitris
Re: EmfMetamodel disposal [message #1802356 is a reply to message #1802353] Thu, 07 February 2019 10:20 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Dimitris,

Thanks! I have updated to the intrim version and it works now. However I've got new problems - the change to EolModule in [1] resulted in the code to break at line 328 [2].

... any ideas please?


[1]. https://bugs.eclipse.org/bugs/show_bug.cgi?id=518570
[2]. https://github.com/wrwei/Jorvik/blob/master/org.eclipse.jorvik.oxygen/src/profile/generation/util/UtilityMethods.java#L328


Research Associate
Department of Computer Science
University of York
Re: EmfMetamodel disposal [message #1802359 is a reply to message #1802356] Thu, 07 February 2019 10:44 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Dimitris,

OK found a workaround, it seems that the context is stored in EglFileGeneratingTemplateFactory instead of EglTemplateFactoryModuleAdapter?
Any advice please?

Cheers!
Will


Research Associate
Department of Computer Science
University of York
Re: EmfMetamodel disposal [message #1802367 is a reply to message #1802359] Thu, 07 February 2019 12:20 Go to previous messageGo to next message
Sina MadaniFriend
Messages: 160
Registered: November 2015
Location: York, UK
Senior Member
Hi WIll,

I think the issue was that EglTemplateFactoryModuleAdapter.getContext() returned current.getModule().getContext(); instead of factory.getContext(). I assumed that "current" (EglTemplate) wouldn't be null, and the intention was to avoid sharing context between factory and module (which is problematic for concurrent execution) but currently they are shared so I've reverted this. Hope that fixes it. Apologies for the inconvenience.

Thanks,
Sina
Re: EmfMetamodel disposal [message #1802371 is a reply to message #1802367] Thu, 07 February 2019 13:04 Go to previous message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Sina,

Thanks! It works now.

Cheers!
Will


Research Associate
Department of Computer Science
University of York
Previous Topic:Model-to-Model transformation beginner question
Next Topic:New EVL Plugin: WebChecker - Bootstrap Linter
Goto Forum:
  


Current Time: Fri Apr 19 06:06:08 GMT 2024

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

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

Back to the top