[
https://issues.jboss.org/browse/ROASTER-36?page=com.atlassian.jira.plugin...
]
Antonio Goncalves updated ROASTER-36:
-------------------------------------
Description:
I have a use case which is : "Take the attribute of type {{java.util.Date}} and
change it to {{org.joda.time.LocalDate}}". Imagine I have the following class :
{code}
public class MyClass {
private Date myFirstDate;
public Date getMyFirstDate() {
return myFirstDate;
}
public void setMyFirstDate(Date myFirstDate) {
this.myFirstDate = myFirstDate;
}
}
{code}
If I only do :
{code}
PropertySource<JavaClassSource> property =
classToProcess.getProperty("myFirstDate");
property.setType(LocalDate.class);
{code}
This changes both the field and the get/set. But the field gets {{LocalDate}} not
qualified, and get/set qualified. This is the final result :
{code}
public class MyClass {
private LocalDate myFirstDate;
public org.joda.time.LocalDate getMyFirstDate() {
return myFirstDate;
}
public void setMyFirstDate(org.joda.time.LocalDate myFirstDate) {
this.myFirstDate = myFirstDate;
}
}
{code}
Only if I do {{property.getAccessor().setReturnType(LocalDate.class)}} I get an
unqualified getter. What I would like is to have unqualified class everywhere when I only
change the type of the property {{property.setType(LocalDate.class)}} :
{code}
public class MyClass {
private LocalDate myFirstDate;
public LocalDate getMyFirstDate() {
return myFirstDate;
}
public void setMyFirstDate(LocalDate myFirstDate) {
this.myFirstDate = myFirstDate;
}
}
{code}
Attached is a test case
was:
I have a use case which is : "Take the attribute of type {{java.util.Date}} and
change it to {{org.joda.time.LocalDate}}". Imagine I have the following class :
{code}
public class MyClass {
private Date myFirstDate;
public Date getMyFirstDate() {
return myFirstDate;
}
public void setMyFirstDate(Date myFirstDate) {
this.myFirstDate = myFirstDate;
}
}
{code}
If I only do :
{code}
PropertySource<JavaClassSource> property =
classToProcess.getProperty("myFirstDate");
property.setType(LocalDate.class);
{code}
This changes both the field and the get/set. But the field gets {{LocalDate}} not
qualified, and get/set qualified. This is the final result :
{code}
public class MyClass {
private LocalDate myFirstDate;
public org.joda.time.LocalDate getMyFirstDate() {
return myFirstDate;
}
public void setMyFirstDate(org.joda.time.LocalDate myFirstDate) {
this.myFirstDate = myFirstDate;
}
}
{code}
Only if I do {{property.getAccessor().setReturnType(LocalDate.class)}} I get an
unqualified getter. What I would like is to have unqualified class everywhere when I only
change the type of the property {{property.setType(LocalDate.class)}} :
{code}
public class MyClass {
private LocalDate myFirstDate;
public LocalDate getMyFirstDate() {
return myFirstDate;
}
public void setMyFirstDate(LocalDate myFirstDate) {
this.myFirstDate = myFirstDate;
}
}
{code}
property.setType leaves get/set with qualified class name
---------------------------------------------------------
Key: ROASTER-36
URL:
https://issues.jboss.org/browse/ROASTER-36
Project: Roaster
Issue Type: Enhancement
Components: API
Affects Versions: 2.7.1.Final
Reporter: Antonio Goncalves
Attachments: roaster.zip
I have a use case which is : "Take the attribute of type {{java.util.Date}} and
change it to {{org.joda.time.LocalDate}}". Imagine I have the following class :
{code}
public class MyClass {
private Date myFirstDate;
public Date getMyFirstDate() {
return myFirstDate;
}
public void setMyFirstDate(Date myFirstDate) {
this.myFirstDate = myFirstDate;
}
}
{code}
If I only do :
{code}
PropertySource<JavaClassSource> property =
classToProcess.getProperty("myFirstDate");
property.setType(LocalDate.class);
{code}
This changes both the field and the get/set. But the field gets {{LocalDate}} not
qualified, and get/set qualified. This is the final result :
{code}
public class MyClass {
private LocalDate myFirstDate;
public org.joda.time.LocalDate getMyFirstDate() {
return myFirstDate;
}
public void setMyFirstDate(org.joda.time.LocalDate myFirstDate) {
this.myFirstDate = myFirstDate;
}
}
{code}
Only if I do {{property.getAccessor().setReturnType(LocalDate.class)}} I get an
unqualified getter. What I would like is to have unqualified class everywhere when I only
change the type of the property {{property.setType(LocalDate.class)}} :
{code}
public class MyClass {
private LocalDate myFirstDate;
public LocalDate getMyFirstDate() {
return myFirstDate;
}
public void setMyFirstDate(LocalDate myFirstDate) {
this.myFirstDate = myFirstDate;
}
}
{code}
Attached is a test case
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)