- changed component to Weaver
- changed milestone to MODELS 2014 Demo
-
assigned issue to
Woven Aspects from reused aspects not woven
Hello,
I tried to load a woven aspect of Observer with both features Active and Pull selected. The weaver produces the woven aspect, however, the tool throws a NullPointer exception in TracingView. I debugged the code, and I found that inside the method initMapWovenAspects(Aspect a), the line List<WovenAspect> wovenAspectsForNext = trNext.getComesFrom(); returns HashSet from the Association concern (Observer reuses Association). And Association does not exist in mapWovenAspects.
Exception in thread "Animation Thread" java.lang.NullPointerException at ca.mcgill.ram.ui.views.TracingView.initMapWovenAspects(TracingView.java:119) at ca.mcgill.ram.ui.views.TracingView.<init>(TracingView.java:77) at ca.mcgill.ram.ui.scenes.DisplayAspectScene.showTracing(DisplayAspectScene.java:697) at ca.mcgill.ram.ui.scenes.DisplayAspectScene.<init>(DisplayAspectScene.java:173) at ca.mcgill.ram.RamApp.getExistingOrCreateAspectScene(RamApp.java:495) at ca.mcgill.ram.RamApp$9.run(RamApp.java:571) at org.mt4j.AbstractMTApplication.runApplication(AbstractMTApplication.java:359) at org.mt4j.AbstractMTApplication.draw(AbstractMTApplication.java:272) at processing.core.PApplet.handleDraw(PApplet.java:1603) at processing.core.PApplet.run(PApplet.java:1502) at java.lang.Thread.run(Thread.java:695)
Comments (14)
-
-
- changed status to resolved
Resolved issue
#170.Solved by adding a line in the structural weaver that propagates the woven aspects from a reused woven model into the base
→ <<cset 22b0ebd92afd>>
-
- changed status to open
Unfortunately this problem is only semi-fixed. If, after weaving, one goes back and weaves again, the same exception occurs again. This happens, because the fix copies the references over, which removes them from its original container. I.e., the woven aspect information is then missing from the instantiated aspect.
-
- changed title to Woven Aspects from reused aspects not woven
-
I found out why this happens:
The StructuralWeaver uses
EcoreUtil.copy(...)
to copy operations when weaving them. This also copies the comesFrom information, which will lead to the copied operation to point to aWovenAspect
instance in the lower-level aspect.This means that (when removing this) it does not happen in the first place.
-
References issue
#170: Temporary fix to avoid having this issue.The reason this occurred is because the StructuralWeaver clones operations and hence, "comesFrom" information is duplicated as well (with the same reference to the "old" WovenAspect).
The weaver now removes this information.
Furthermore, adding the list is removed (see comment above).
Finally, the TracingView is now more robust in that it does not crash if the woven aspect is not in the map. In general, this should not occur, which is why an error is logged.
→ <<cset f10ea637f7c5>>
-
In our meeting on Oct. 16 we decided to move tracing up to CORE. Then,
COREModel
will contain this information, but the woven information will refer directly to all elements that were woven. I.e.,Traceable
elements don't have the "comesFrom" reference.That means, in order to find out which elements were woven from another model, it is enough to look up the list of woven elements (suggestion:
wovenElements
) in the woven model element (suggestion:WovenModel
). I.e., not allTraceableElement
s need to be looked at to check whether they contain such information).In addition, we decided that it is not necessary to keep track of (i.e., to store) the complete weaving hierarchy in the woven model, because this information can be obtained by going back/looking at the reused model from the reused concern. The reused concern is copied into the current concerns folder so it will always be possible to access this information (model evolution does not impact it).
-
- removed milestone
-
assigned issue to
-
References
#170: changed association direction between WovenAspect and Traceable→ <<cset b3900c505c14>>
-
References
#170cleaned model files to prevents crashes→ <<cset 0a6dadd11d41>>
-
References
#170: tracing now goes through the hierarchy of woven aspects→ <<cset f0218eabc25c>>
-
References
#170: tracing gui now displays the hierarchy of woven aspects in a tree→ <<cset cd67caeec95f>>
-
Merged in issues/170-woven-aspects-tracing (pull request #29)
References
#170: Tracing update→ <<cset 7bd929ea9bfb>>
-
- changed status to resolved
- Log in to comment