Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [henshin-dev] Update of Nightly Build / Issue using Java 8 Nashorn JS Engine

Hi Markus,

thanks for giving us feedback. We currently have some connectivity problems in our build setup. Hopefully the nightly build will work again soon.

Regarding your problem: we cannot just search for dots in the JS code -- we would need a proper parsing here. I think a clean way of doing it would be a possibility for specifying JS package imports. Do you think this makes sense?

Cheers,
Christian



2014-06-30 12:35 GMT+02:00 <mke@xxxxxxxxxx>:

Hi there,

 

I was curious that the latest nightly build was created over a month ago. Especially after the commit of Christian Krause regarding the fixes for Java 8, I’d like to ask, if you could create a new build containing these fixes.

 

The issue we are facing is the following. Right now the package import to the JS Engine is not working. I saw that the importing issue should be solved by adding the rhino compatibility mode. Still there is a problem in the evaluation of attributes/variables:

 

We are calling a static method in a java class using the fully qualified name. The attribute value is set to lets say:

 

Attribute = “This is the new attribute value: ” + de.mypackage.StringCreator.createString(var)

 

where createString is a static method using a String parameter.

 

The issue is, that the attribute evaluator in the EngineImpl does not recognize the variable  de.mypackage.StringCreator.createString(var) as a full qualified Java Class, hence we get the following error message:

 

java.lang.RuntimeException: ReferenceError: "de" is not defined in <eval> at line number 1

       at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.evalAttributeExpression(EngineImpl.java:906)

       at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.createChanges(EngineImpl.java:861)

       at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.createChanges(EngineImpl.java:876)

       at org.eclipse.emf.henshin.interpreter.impl.EngineImpl.createChange(EngineImpl.java:756)

       at org.eclipse.emf.henshin.interpreter.impl.RuleApplicationImpl.execute(RuleApplicationImpl.java:99)

       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.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.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.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.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)

 

I fixed this issue by adding a conditional check if the attribute.getValue() String contains any “.” elements and added a “importPackage(de.mypackage)” before the actual evaluation, maybe you could add a similar check to make it work in the nightly build as well.

 

Greetings and thanks for all your work,

 

Markus

 


_______________________________________________
henshin-dev mailing list
henshin-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/henshin-dev



Back to the top