Bug 412761 - [active annotations] typeReference of two enclosing class having the same name
Summary: [active annotations] typeReference of two enclosing class having the same name
Status: UNCONFIRMED
Alias: None
Product: Xtend
Classification: Tools
Component: Backlog (show other bugs)
Version: 2.4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-11 09:34 EDT by Mat Vidal CLA
Modified: 2013-07-11 09:50 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mat Vidal CLA 2013-07-11 09:34:32 EDT
regarding this bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=391779

If you have two enclosing classes sharing the same name

public class Foo {
	public class Bar {
	}
}

public class Fighter<A> {
	public class Bar {
	}
}

The generated code will associate "Bar" reference simpleName to the first (here Foo.Bar)

I've found this problem when creating two different methods each one with one of these two classes :

http://docs.oracle.com/javafx/2/api/javafx/scene/chart/PieChart.Data.html
http://docs.oracle.com/javafx/2/api/javafx/scene/chart/XYChart.Data.html

Only the returnType property of the new method "see the trap" :
public Data _PieChart_Data(....
public <X, Y> javafx.scene.chart.XYChart.Data<?,?> _XYChart_Data(...

NewTypeReference do not see the trap and write the simpleName (which has been first associated to PieChart.Data)
Comment 1 Mat Vidal CLA 2013-07-11 09:50:17 EDT
There is also a strange behavior about the methods I use as a template to create the others :


protected def _PieChart_Data(String name, Double value)	{new PieChart.Data(name, value)}

protected def <X,Y> _XYChart_Data()   {new XYChart.Data<X,Y> ()}

gives that result :

protected Data _PieChart_Data(final String name, final Double value) {
    Data _data = new Data(name, (value).doubleValue());
    return _data;
}

protected <X, Y> javafx.scene.chart.XYChart.Data<X,Y> _XYChart_Data() {
    javafx.scene.chart.XYChart.Data<X,Y> _data = new javafx.scene.chart.XYChart.Data<X,Y>();
    return _data;
}