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

Bug 312220

Summary: [Xtext] Serialization raises NPE when processing rule with hidden terminal rules
Product: [Modeling] TMF Reporter: Johan Wannheden <johan.wannheden>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: moritz.eysholdt, sebastian.zarnekow
Version: 0.7.0Flags: sebastian.zarnekow: helios+
Target Milestone: RC1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Johan Wannheden CLA 2010-05-10 04:48:20 EDT
Build Identifier: 20100218-1602

The following grammar with rule for root object contains a rule defining the header of a model instance. No terminal rules are hidden and thus WS is explicitly given, a model instance must contain the exact text "[mydsl 1.0]" with arbitrary numbers.

MyDsl :
    header=MyDslHeader
    'mydls' name=ID
    ...
;

MyDslHeader hidden() : 
    '[' 'mydsl' WS majorVersion=INT '.' minorVersion=INT ']'
;

When serializing a model instance (using Xtext 1.0.0 M7) an NPE is raised in

org.eclipse.xtext.validation.impl.ConcreteSyntaxConstraintProvider.createElement

on line 336 because "ele" is null.

Reproducible: Always
Comment 1 Moritz Eysholdt CLA 2010-05-10 05:02:15 EDT
I'll take a look at this shortly.
Comment 2 Moritz Eysholdt CLA 2010-05-10 08:10:30 EDT
This is actually the ConcreteSyntaxConstraintProvider having trouble to digest unassigned rule calls.
Comment 3 Moritz Eysholdt CLA 2010-05-10 08:20:33 EDT
Fixed in HEAD.
Comment 4 Karsten Thoms CLA 2017-09-19 16:13:45 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.