Community
Participate
Working Groups
I get the following exception on AQL completion : Caused by: java.lang.NullPointerException at java.util.ComparableTimSort.countRunAndMakeAscending(ComparableTimSort.java:291) at java.util.ComparableTimSort.sort(ComparableTimSort.java:157) at java.util.ComparableTimSort.sort(ComparableTimSort.java:146) at java.util.Arrays.sort(Arrays.java:472) at java.util.Collections.sort(Collections.java:155) at org.eclipse.acceleo.query.parser.AstCompletor.getProposals(AstCompletor.java:90) at org.eclipse.acceleo.query.runtime.impl.QueryCompletionEngine.getCompletion(QueryCompletionEngine.java:73) at org.eclipse.sirius.common.acceleo.aql.ide.proposal.AQLProposalProvider.getProposals(AQLProposalProvider.java:102) at org.eclipse.sirius.common.acceleo.aql.ide.proposal.AQLProposalProvider.getProposals(AQLProposalProvider.java:76) at org.eclipse.sirius.common.tools.api.interpreter.CompoundInterpreter.getProposals(CompoundInterpreter.java:836) 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.access$10(ContentProposalAdapter.java:2043) at org.eclipse.jface.fieldassist.ContentProposalAdapter$ContentProposalPopup.recomputeProposals(ContentProposalAdapter.java:1018) at org.eclipse.jface.fieldassist.ContentProposalAdapter$ContentProposalPopup.access$14(ContentProposalAdapter.java:1017) at org.eclipse.jface.fieldassist.ContentProposalAdapter$ContentProposalPopup$5.run(ContentProposalAdapter.java:1045) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136) ... 24 more
Created attachment 258604 [details] Project to reproduce Steps to reproduce: 1. Import the attached project 2. Open the odesign 3. Select the "Select Model Element Variable" 4. Through properties view, in "Candidates Expression", type "Ctrl+Space" to have completion and type "aql:" and "Esc" => KO the exception occurs In addition the UI is not very responsive on "aql:" writing.
I have this bug with Sirius 3.1.3.201511201007 and AQL 4.0.0.201510121214 but I reproduce also on Sirius master at this time.
I could reproduce with the given project and Sirius/AQL master. The root cause is that the "Select Model Element Variable" has no name and returns "null" for it. Sirius does not ignore this and try to declare a variable having "null" as a name (which is quite obviously illegal). In the end AQL fails because of null keys in the variable definition maps.
New Gerrit change created: https://git.eclipse.org/r/64156
Gerrit change https://git.eclipse.org/r/64156 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a5f403515c75f29ee8943d7ae7b1492a2dae1b31
Is this fixed by the merged commit? If so, please either add an non-regression test or mark the ticket as FIXED but with the "needtest" tag in the whiteboard field.
Moving to M6, as this is probably fixed but the status is not clear.
Indeed it is fixed. This is not specific to AQL (hence the fix is not), a variable with a "null" name would have ended up in the calls to the interpreters validation/completion API, leading to a NPE. Adding the "needtest" tag by default, I test should not be too hard to add but on the other hand the scenario is a variable wich has no name (and that, IMO, should probably be an invalid VSM. I just checked and it is not the case right now. I'd like to have another opinion on wheter we should spend more time in adding the test or making sure the metamodel consider a null variable name an error...
New Gerrit change created: https://git.eclipse.org/r/69325
(In reply to Cedric Brun from comment #8) > Indeed it is fixed. > > This is not specific to AQL (hence the fix is not), a variable with a "null" > name would have ended up in the calls to the interpreters > validation/completion API, leading to a NPE. > > Adding the "needtest" tag by default, I test should not be too hard to add > but on the other hand the scenario is a variable wich has no name (and that, > IMO, should probably be an invalid VSM. I just checked and it is not the > case right now. > > I'd like to have another opinion on wheter we should spend more time in > adding the test or making sure the metamodel consider a null variable name > an error... https://git.eclipse.org/r/69325 is a first attempt to add the necessary validation rule. It looks like VSMValidationTest would be the automated test to complete to check for this.
Gerrit change https://git.eclipse.org/r/69325 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=3866ea64849aa14b93bf89a875d3214436dbd415
Closing, as commit 3866ea64849aa14b93bf89a875d3214436dbd415 adds a validation rule about empty/blank variable names and the associated test.
Verified on Sirius 4.0.0.RC1
Available in Sirius 4.0.0.