[forge-issues] [JBoss JIRA] (ROASTER-36) property.setType leaves get/set with qualified class name
Antonio Goncalves (JIRA)
issues at jboss.org
Thu Sep 11 05:04:19 EDT 2014
[ https://issues.jboss.org/browse/ROASTER-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
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}
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 :
{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
>
> 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}
--
This message was sent by Atlassian JIRA
(v6.3.1#6329)
More information about the forge-issues
mailing list