Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326025 - [Xpand] NPE on recreation when using Xpand incremental generation
Summary: [Xpand] NPE on recreation when using Xpand incremental generation
Status: CLOSED WONTFIX
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Karsten Thoms CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 374876
Blocks:
  Show dependency tree
 
Reported: 2010-09-23 05:03 EDT by Roman Zimmer CLA
Modified: 2020-04-30 13:53 EDT (History)
1 user (show)

See Also:


Attachments
Sample project (12.14 KB, application/x-zip)
2010-09-23 05:03 EDT, Roman Zimmer CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Zimmer CLA 2010-09-23 05:03:47 EDT
Created attachment 179440 [details]
Sample project

I was trying to take advantage of the incremental generation process in Xpand (latest version from official update site).

When executing the workflow, the initial generation works flawless. However, if I regenerate my project, I get a NPE independently if I changed my model or not.

Here is a stack trace:

java.lang.NullPointerException
	at org.eclipse.xpand2.incremental.IncrementalGenerationCallback.hasRelevantChangeForFile(IncrementalGenerationCallback.java:181)
	at org.eclipse.xpand2.incremental.IncrementalGenerationCallback.handleFileStatement(IncrementalGenerationCallback.java:143)
	at org.eclipse.xpand2.incremental.IncrementalGenerationCallback.pre(IncrementalGenerationCallback.java:123)
	at org.eclipse.xpand2.incremental.IncrementalGenerationFacade.pre(IncrementalGenerationFacade.java:163)
	at org.eclipse.internal.xpand2.ast.Statement.evaluate(Statement.java:35)
	at org.eclipse.internal.xpand2.ast.AbstractDefinition.evaluate(AbstractDefinition.java:180)
	at org.eclipse.internal.xpand2.ast.ExpandStatement.invokeDefinition(ExpandStatement.java:246)
	at org.eclipse.internal.xpand2.ast.ExpandStatement.evaluateInternal(ExpandStatement.java:191)
	at org.eclipse.internal.xpand2.ast.Statement.evaluate(Statement.java:41)
	at org.eclipse.internal.xpand2.ast.AbstractDefinition.evaluate(AbstractDefinition.java:180)
	at org.eclipse.internal.xpand2.ast.ExpandStatement.invokeDefinition(ExpandStatement.java:246)
	at org.eclipse.internal.xpand2.ast.ExpandStatement.evaluateInternal(ExpandStatement.java:226)
	at org.eclipse.internal.xpand2.ast.Statement.evaluate(Statement.java:41)
	at org.eclipse.xpand2.Generator.invokeInternal2(Generator.java:333)
	at org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowComponent.invokeInternal(AbstractExpressionsUsingWorkflowComponent.java:239)
	at org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent.invoke(AbstractWorkflowComponent.java:126)
	at org.eclipse.emf.mwe.core.container.CompositeComponent.internalInvoke(CompositeComponent.java:104)
	at org.eclipse.emf.mwe.core.container.CompositeComponent.invoke(CompositeComponent.java:89)
	at org.eclipse.emf.mwe.core.WorkflowRunner.executeWorkflow(WorkflowRunner.java:408)
	at org.eclipse.emf.mwe.core.WorkflowRunner.run(WorkflowRunner.java:293)
	at org.eclipse.emf.mwe.core.WorkflowRunner.main(WorkflowRunner.java:241)

I tried to debug. Obviously there seems to be a wrong handling of null values. The NPE arises when checking files that have not changed since the last generation.

I attached a sample project to reproduce the issue. When first running src/main/resources/incremental.mwe, it should work. The second time it will crash and delete all perviously generated files. This would continue infinitely.

If you need further information, I'll try my best to provide them!
Comment 1 Karsten Thoms CLA 2020-04-30 13:53:46 EDT
This is a batch close of open M2T Xpand bugs. It is not planned work on this component in the foreseeable future. If you think this issue needs to be solved and you plan to contribute a fix then feel free to reopen it.