Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Problem with rule-nesting

Hi Sebastien,

we recently changed the parameter handling in multi-rules. This introduced a regression which caused the NPE in your example. We try to fix it as soon as possible.

Cheers,
Christian

2015-01-28 9:13 GMT+01:00 Sébastien Pasero <sebastien.pasero@xxxxxx>:
Hi Christian,

Thank you for your answer.
Now I can reproduce the NPE :
Exception in thread "main" java.lang.NullPointerException
    at org.eclipse.emf.henshin.interpreter.impl.ChangeImpl$ReferenceChangeImpl.applyAndReverse(ChangeImpl.java:230)
    at org.eclipse.emf.henshin.interpreter.impl.ChangeImpl$CompoundChangeImpl.applyAndReverse(ChangeImpl.java:470)
    at org.eclipse.emf.henshin.interpreter.impl.RuleApplicationImpl.execute(RuleApplicationImpl.java:106)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.executeRule(UnitApplicationImpl.java:175)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.doExecute(UnitApplicationImpl.java:99)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.execute(UnitApplicationImpl.java:89)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.executeSequentialUnit(UnitApplicationImpl.java:222)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.doExecute(UnitApplicationImpl.java:103)
    at org.eclipse.emf.henshin.interpreter.impl.UnitApplicationImpl.execute(UnitApplicationImpl.java:89)
    at org.eclipse.emf.henshin.interpreter.util.InterpreterUtil.executeOrDie(InterpreterUtil.java:254)
    at org.eclipse.example.Left2Right.main(Left2Right.java:35)

The sources of my example are enclosed.

Regards,
Sebastien
Le 27/01/2015 19:11, Christian Krause a écrit :
Hi Sebastien,

the save method you internally uses the method ResourcesSet.createResource(), see

The JavaDoc reads: It delegates to the resource factory registry to determine the correct factory, and then it uses that factory to create the resource and adds it to the contents. If there is no registered factory, null will be returned; when running within Eclipse, a default XMI factory will be registered, and this will never return null.

In your case, you are trying to save the model into a file with the extension *.right. There is no resource factory registered for this file extension. You have two options: either register a resource factory for the "right" extension, or save it as an *.xmi file.

Cheers,
Christian


2015-01-27 10:02 GMT+01:00 Sébastien Pasero <sebastien.pasero@xxxxxx>:
Hi Christian,

The EObject returned by the UnitApplication seems correct :
org.eclipse.emf.ecore.impl.DynamicEObjectImpl@1e932e (eClass: org.eclipse.emf.ecore.impl.EClassImpl@150b632 (name: Right) (instanceClassName: null) (abstract: false, interface: false))

The LoggingApplicationMonitor printed the following log :
=== (1) EXECUTED RULE 'CreateRoot' [TRUE] ===

Graph size: 6 nodes, 5 edges

Match for rule 'CreateRoot':
- node #1 => left.Left@1771b9b (dynamic)

Result match for rule 'CreateRoot':
- parameter 'result' => right.Right@1e932e (dynamic)
- node #1 => left.Left@1771b9b (dynamic)
- node #2 => org.eclipse.emf.henshin.trace.impl.TraceImpl@5d003b (name: null)
- node 'result' => right.Right@1e932e (dynamic)

=== (2) EXECUTED UNIT 'doTransfo' [TRUE] ===

Graph size: 6 nodes, 5 edges

Result assignment for unit 'doTransfo':
- parameter 'result' => right.Right@1e932e (dynamic)


Could you tell me if anything looks wrong ?

Regards,
Sebastien

Le 26/01/2015 20:51, Christian Krause a écrit :

PS: See http://wiki.eclipse.org/Henshin_Interpreter for more info on the LoggingApplicationMonitor and the interpreter in general.

Am 26.01.2015 20:44 schrieb "Christian Krause" <henshin.ck@xxxxxxxxx>:

Hi Sebastian,

I didn't look into your source code but your stack trace tells me that the error happens during the saving of the model. This could mean that your transformation was not successful or that you didnt extract the result of the transformation correctly. First you should make sure that the transformation was correctly executed. You could set a breakpoint after the transformation execution and look into the contents oft the EGraph. Alternatively you could pass  a LoggingApplicationMonitor to your unit application to get debug output. See also the wiki on the Henshin interpreter.

Cheers,
Christian

Am 26.01.2015 17:35 schrieb "Sébastien Pasero" <sebastien.pasero@xxxxxx>:
Hi Christian,

I tried to reproduce the issue, but I got another error instead :
Exception in thread "main" java.lang.NullPointerException
    at org.eclipse.emf.henshin.model.resource.HenshinResourceSet.saveEObject(HenshinResourceSet.java:358)
    at org.eclipse.emf.henshin.model.resource.HenshinResourceSet.saveEObject(HenshinResourceSet.java:346)
    at org.eclipse.example.Left2Right.main(Left2Right.java:37)

Could you help me with this ?

Le 23/01/2015 17:58, Christian Krause a écrit :
Hi Sebastien,

I hope we can fix the editor bug soon. Regarding your NPE at runtime, we need a stack trace and ideally your example.

Cheers,
Christian


2015-01-23 17:09 GMT+01:00 Sébastien Pasero <sebastien.pasero@xxxxxx>:
Hi,

I would like to use rule-nesting, just like it's used in Ecore2Rdb example.
I have really basic ecore models.
My source ecore model "left.ecore" contains a main class called "Left", which can contain 0 or more classes named "LeftChild".
My target ecore model "right.ecore" contains a main class called "Right", which can contain 0 or more classes named "RightChild".

In my Henshin diagram, I can design the transformation of "Left" to "Right" (using Trace model), which works fine.
For the transformation of "LeftChild" to "RightChild", I'm trying to use rule-nesting :
In the same rule, I can add the following classes:
 - "preserve*/children" :LeftChild
 - "create*/children" :Trace
 - "create*/children" :RightChild



But when it comes to adding edges, I can not connect "Right" to "RightChild".
If I change the annotation to "create", I can create the edge.
Then I change the annotation back to "create*/children", but I get a NullPointerException at runtime.

The only way to make it work is to create another rule where my "Right" class is already created ("preserve" annotation).

Could you help me to find out what I'm missing to make it work ?

Regards,
Sebastien

_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev
_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev


_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev

_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev

--
CS CS BLOG MAILTO



_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/henshin-dev


Back to the top