ModelDriven / Alf-Reference-Implementation

Open-source implementation of the Action Language for fUML (Alf) specification.
30 stars 2 forks source link

ElementFactory needs explicit initialization when used through o.m.a.eclipse plugin #13

Closed JoriDubrovin closed 8 years ago

JoriDubrovin commented 8 years ago

Apparently, you need an explicit new org.modeldriven.alf.eclipse.uml.ElementFactory(); before using the functionality of org.modeldriven.alf.eclipse, otherwise you get NPEs. This is a minor nuisance.

Using v0.6.0g.

seidewitz commented 8 years ago

This is due to a change made in order to avoid redundant instantiation of element factories. The ElementFactory constructor call is handled automatically when you instantiate an AlfCompiler. Nevertheless, the new approach is still probably not the best way to do this. There is a better alternative that avoids the redundancy but also does not require an explicit constructor call.

seidewitz commented 8 years ago

It is now unnecessary to explicitly call the ElementFactory constructor, as before. Indeed, there is now no org.modeldriven.alf.eclipse.uml.ElementFactory() constructor at all. If an element factory reference is needed, use org.modeldriven.alf.eclipse.uml.Element.FACTORY.

JoriDubrovin commented 8 years ago

v0.6.0h works for us without the explicit initialization step.

seidewitz commented 8 years ago

Resolved in v0.6.0h.