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

Bug 345722

Summary: [Xtend] Java/Xtend name conflicts in generated Java classes extending Java class with same name but from different package
Product: [Modeling] TMF Reporter: Maxim Frolov <maxim.frolov>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: maxim.frolov, sebastian.zarnekow
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

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