Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347939 - Using an Element named "Boolean" in an xtend2 generator produces invalid java code
Summary: Using an Element named "Boolean" in an xtend2 generator produces invalid java...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: SR2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-01 09:38 EDT by hendrik CLA
Modified: 2017-09-19 17:56 EDT (History)
3 users (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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