Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323003 - ConcreteSyntaxConstraintProvider missing "return null" in method createElement
Summary: ConcreteSyntaxConstraintProvider missing "return null" in method createElement
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: M4   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-18 05:28 EDT by Christoph Zwicker CLA
Modified: 2017-09-19 17:52 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: helios+
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Zwicker CLA 2010-08-18 05:28:21 EDT
Build Identifier: 20100617-1415

In the case of an optional group containing no "relevant element", parse tree reconstruction fails.

The section treating "Group" || "UnorderedGroup" should probably return null if no "lastChild" is found (as does e.g. the section treating Alternatives).

Reproducible: Always

Steps to Reproduce:
1. Introduce something like ( '(' INT ')' )? into a rule, test parse tree reconstruction
2. 
3.
Comment 1 Moritz Eysholdt CLA 2010-08-23 08:02:51 EDT
I cannot reproduce the with rules like
Model: foo=ID ('(' INT ')')?;
or 
Model: foo=ID | ('(' INT ')')?;
because here the section for Groups and UnorderedGroups is never called because the caller checks in advance if a group contains a relevant element.

I can reproduce the behavior this rule:
Model: ('(' INT ')')?;
However, this is a datatype-rule and therefore the concrete syntax constraint provider is not responsible for it. It's a datatype rule because it doesn't contain an assignment.

Could you provide more details how you ran into this problem?
Comment 2 Sebastian Zarnekow CLA 2010-11-14 07:13:03 EST
The bug could be reproduced with the following rule:

Model: ('(' INT ')') a=STRING b=STRING;

Fixed in master and Helios_Maintenance.
Comment 3 Karsten Thoms CLA 2017-09-19 17:41:23 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:52:31 EDT
Closing all bugs that were set to RESOLVED before Neon.0