Bug 487245 - NullPointerException in EvaluationServices
Summary: NullPointerException in EvaluationServices
Status: RESOLVED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Query Language (show other bugs)
Version: 3.6.0   Edit
Hardware: PC Mac OS X
: P3 normal
Target Milestone: ---   Edit
Assignee: Yvan Lussaud CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-04 10:37 EST by Stephane Begaudeau CLA
Modified: 2016-03-23 06:51 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephane Begaudeau CLA 2016-02-04 10:37:25 EST
I have the expression "aql:self.eGet(eStructuralFeature)" but I have failed to provide the variable "eStructuralFeature". In my use case, my variable self is a regular Class from a very simple ecore model. This issue comes from the method EvaluationServices#getEParameters(...) and from this line:

for (EClassifier eClassifier : queryEnvironment.getEPackageProvider().getEClass(object.getClass()))

Because "object" is Nothing with the message "Couldn't find the eStructuralFeature variable".


STACK 0
org.eclipse.acceleo.query.runtime.AcceleoQueryEvaluationException: An internal error occured during evaluation of a query
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.callOrApply(EvaluationServices.java:518)
	at org.eclipse.acceleo.query.parser.AstEvaluator.caseCall(AstEvaluator.java:193)
	at org.eclipse.acceleo.query.ast.util.AstSwitch.doSwitch(AstSwitch.java:129)
	at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:53)
	at org.eclipse.emf.ecore.util.Switch.doSwitch(Switch.java:69)
	at org.eclipse.acceleo.query.parser.AstEvaluator.eval(AstEvaluator.java:102)
	at org.eclipse.acceleo.query.runtime.impl.QueryEvaluationEngine.eval(QueryEvaluationEngine.java:52)
	MY CODE AND ECLIPSE AND EQUINOX AND THE REST OF THE WORLD...
Caused by: org.eclipse.acceleo.query.runtime.AcceleoQueryEvaluationException: An internal error occured during evaluation of a query
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.call(EvaluationServices.java:296)
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.callOrApply(EvaluationServices.java:512)
	... 79 more
Caused by: java.lang.NullPointerException
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.getEParameters(EvaluationServices.java:470)
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.callEOperation(EvaluationServices.java:319)
	at org.eclipse.acceleo.query.runtime.impl.EvaluationServices.call(EvaluationServices.java:283)
	... 80 more
Comment 1 Yvan Lussaud CLA 2016-02-05 08:48:39 EST
EvaluationServices#getEParameters(...) will be removed by https://git.eclipse.org/r/#/c/65473

I will add a test just to make sure...
Comment 2 Eclipse Genie CLA 2016-02-05 09:07:12 EST
New Gerrit change created: https://git.eclipse.org/r/66017