Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345722 - [Xtend] Java/Xtend name conflicts in generated Java classes extending Java class with same name but from different package
Summary: [Xtend] Java/Xtend name conflicts in generated Java classes extending Java cl...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: RC1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-13 08:14 EDT by Maxim Frolov CLA
Modified: 2017-09-19 18:04 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim Frolov CLA 2011-05-13 08:14:11 EDT
Build Identifier: [Xtend] Java/Xtend class name clash

Assume we have Java Class A:

package x.y.z;
class A {
}


and Xtend class A:

package x.y;
class A extends x.y.z.A {
}

The Xtend editors shows no errors, but the generated Java class x.y.A.java does:

package x.y;
import x.y.z.A;
@SuppressWarnings("all")
public class A extends A {
}

The errors are on 
line 2 (name conflict): import x.y.z.A;
line 4 (cycle detected): public class A extends A {

The Java code generated correctly should looks like this:

package x.y;
@SuppressWarnings("all")
public class A extends x.y.z.A {
}


Reproducible: Always

Steps to Reproduce:
See Bug Details
Comment 1 Maxim Frolov CLA 2011-05-13 08:16:11 EDT
The bug was detected with Xtext SDK 2.0.0.v201105031504.
Comment 2 Sebastian Zarnekow CLA 2011-05-13 08:38:12 EDT
We have to initialize the import manager with our own class name.
Comment 3 Sebastian Zarnekow CLA 2011-05-13 08:42:01 EDT
Pushed to master.
Comment 4 Karsten Thoms CLA 2017-09-19 17:53:44 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 5 Karsten Thoms CLA 2017-09-19 18:04:24 EDT
Closing all bugs that were set to RESOLVED before Neon.0