[
https://issues.jboss.org/browse/ROASTER-105?page=com.atlassian.jira.plugi...
]
Nicolas Challut commented on ROASTER-105:
-----------------------------------------
[~gastaldi]I find where the problem is. In this commit, the regression is introduce :
https://github.com/forge/roaster/commit/541472e80de5d7ac08d25479254cecd34...
This code doesn't return the same resolveType
{code:java}
String resolvedType = imprt != null ?
Types.rebuildGenericNameWithArrays(imprt.getSimpleName(),innerType) :
Types.toSimpleName(typeName);
{code}
than this code
{code:java}
String simpleName = Types.toSimpleName(typeName);
{code}
I'll try to provide a PR but it's a little bit touchy for me :S
addProperty with generic value doesn't transform import
-------------------------------------------------------
Key: ROASTER-105
URL:
https://issues.jboss.org/browse/ROASTER-105
Project: Roaster
Issue Type: Bug
Affects Versions: 2.14.0.Final
Reporter: Nicolas Challut
{code:java}
@Test
public void addGenericAndGetPropertyType()
{
JavaClassSource classSource = Roaster.create(JavaClassSource.class);
classSource.addProperty("java.util.List<java.lang.String>",
"list");
PropertySource<JavaClassSource> property =
classSource.getProperty("list");
Type<JavaClassSource> propertyType = property.getType();
assertEquals("List<String>", propertyType.toString());
}
@Test
public void addGenericAndGetFieldType()
{
JavaClassSource classSource = Roaster.create(JavaClassSource.class);
classSource.addProperty("java.util.List<java.lang.String>",
"list");
PropertySource<JavaClassSource> property =
classSource.getProperty("list");
FieldSource<JavaClassSource> field = property.getField();
Type<JavaClassSource> fieldType = field.getType();
assertEquals("List<String>", fieldType.toString());
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)