Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 433821

Summary: Completion on Acceleo expressions is not available in VSM if an empty service class is registered
Product: [Modeling] Sirius Reporter: Stéphane Thibaudeau <stephane.thibaudeau>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: esteban.dugueperoux, pierre-charles.david
Version: 1.0.0M5Keywords: triaged
Target Milestone: 2.0.0   
Hardware: PC   
OS: Windows 7   
Whiteboard: trivial
Bug Depends on:    
Bug Blocks: 439103, 453053    

Description Stéphane Thibaudeau CLA 2014-04-30 04:59:59 EDT
Symptom :
Autocompletion on Acceleo 3 expressions is not available anymore when editing an odesign file. The autocompletion on interpreters prefix ('[/]', 'var:' , 'feature:', ...) still works, it works too for the 'var:' interpreter (probably for the others too but I havent tested).

Cause :
In the odesign file, a java extension was pointing to an empty class (no service method in it). The code compiling an acceleo 3 template from this class throws a NullPointerException.
Comment 1 Esteban DUGUEPEROUX CLA 2014-05-05 05:15:55 EDT
I reproduce the NPE :


java.lang.NullPointerException
	at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.DynamicAcceleoModule.compileExtendedDependencies(DynamicAcceleoModule.java:752)
	at org.eclipse.sirius.common.acceleo.mtl.ide.AcceleoProposalProvider.getProposals(AcceleoProposalProvider.java:131)
	at org.eclipse.sirius.common.tools.api.interpreter.CompoundInterpreter.getProposals(CompoundInterpreter.java:785)
	at org.eclipse.sirius.ui.tools.api.assist.TextContentProposalProvider.getProposals(TextContentProposalProvider.java:88)
	at org.eclipse.jface.fieldassist.ContentProposalAdapter.getProposals(ContentProposalAdapter.java:2057)
	at org.eclipse.jface.fieldassist.ContentProposalAdapter.openProposalPopup(ContentProposalAdapter.java:1903)
	at org.eclipse.jface.fieldassist.ContentProposalAdapter.access$16(ContentProposalAdapter.java:1898)
	at org.eclipse.jface.fieldassist.ContentProposalAdapter$1.handleEvent(ContentProposalAdapter.java:1769)

with the following scenario:
1. Create a Viewpoint Specification Project
2. Create a test.Service empty java class
3. In the opened odesign, create a Diagram Description and a Java Extension setting test.Service for this last
4. In the precondition of the Diagram Description test completion in [/] => the NPE is thrown

The cause of this NPE comes from that CompilationResult has a null status. We can consider that a null status corresponds to a OK status.
Comment 2 Esteban DUGUEPEROUX CLA 2014-05-05 05:53:39 EDT
 https://git.eclipse.org/r/25955 has been submitted to Gerrit, remains junit test.
Comment 3 Esteban DUGUEPEROUX CLA 2014-07-01 10:03:08 EDT
Fixed as a56c2016821dbf41b0ffd8a8831c88598a17d764 .
Comment 4 Pierre-Charles David CLA 2014-10-27 06:52:19 EDT
Available in Sirius 2.0.0.
Comment 5 Pierre-Charles David CLA 2014-11-24 09:53:24 EST
Cloned as bug 453053 to backport to 1.0.2.