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

Bug 347939

Summary: Using an Element named "Boolean" in an xtend2 generator produces invalid java code
Product: [Modeling] TMF Reporter: hendrik
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: jan, moritz.eysholdt, sven.efftinge
Version: unspecifiedFlags: sven.efftinge: indigo+
Target Milestone: SR2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description hendrik CLA 2011-06-01 09:38:21 EDT
Build Identifier: 20110526-1053

Using an xtext grammar containing an element named Boolean in an xtend2 generator breaks the generated java code.

The user defined type "Boolean" is imported in the java source file. So the java.lang.Boolean is covert. But lot of generated code fragements use java.lang.Boolean without the full qualified name. Thus the code is erroneous at multiple places.


Reproducible: Always

Steps to Reproduce:
1. Create an xtext grammar with an element named "Boolean"
2. Create an xtend2 generator script with a function that returns an boolean value
3.
Comment 1 Moritz Eysholdt CLA 2011-06-01 09:48:56 EDT
org.eclipse.emf.codegen.util.CodeGenUtil.isJavaDefaultType(String) can be used to check for collisions with built-in identifiers of Java.
Comment 2 Jan Koehnlein CLA 2011-10-27 09:15:46 EDT
Should be fixed in HEAD with latest changes to ImportManager.
Please verify.
Comment 3 Karsten Thoms CLA 2017-09-19 17:45:32 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:56:33 EDT
Closing all bugs that were set to RESOLVED before Neon.0