We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If a Pojo contains two fields with different types but with identical simple names the generated builder does not compile. Example Pojo to reproduce:
import net.karneim.pojobuilder.GeneratePojoBuilder; @GeneratePojoBuilder public class PojoSameSimpleName { private java.util.Date utilDate; private java.sql.Date sqlDate; public java.util.Date getUtilDate() { return utilDate; } public void setUtilDate(java.util.Date utilDate) { this.utilDate = utilDate; } public java.sql.Date getSqlDate() { return sqlDate; } public void setSqlDate(java.sql.Date sqlDate) { this.sqlDate = sqlDate; } }
Generated builder:
import java.sql.Date; import java.util.Date; import javax.annotation.Generated; import net.karneim.pojobuilder.GwtIncompatible; @Generated("PojoBuilder") public class PojoSameSimpleNameBuilder implements Cloneable { protected PojoSameSimpleNameBuilder self; protected Date value$utilDate$java$util$Date; protected boolean isSet$utilDate$java$util$Date; protected Date value$sqlDate$java$sql$Date; protected boolean isSet$sqlDate$java$sql$Date; /** * Creates a new {@link PojoSameSimpleNameBuilder}. */ public PojoSameSimpleNameBuilder() { self = (PojoSameSimpleNameBuilder)this; } /** * Sets the default value for the {@link PojoSameSimpleName#utilDate} property. * * @param value the default value * @return this builder */ public PojoSameSimpleNameBuilder withUtilDate(Date value) { this.value$utilDate$java$util$Date = value; this.isSet$utilDate$java$util$Date = true; return self; } /** * Sets the default value for the {@link PojoSameSimpleName#sqlDate} property. * * @param value the default value * @return this builder */ public PojoSameSimpleNameBuilder withSqlDate(Date value) { this.value$sqlDate$java$sql$Date = value; this.isSet$sqlDate$java$sql$Date = true; return self; } // ... }
The compiler complains about the import statements:
The import java.util.Date collides with another import statement
It would be nice if pojobuilder would support such Pojos.
Probably full qualified type names have to be used throughout the builder (for at least those duplicate types).
The text was updated successfully, but these errors were encountered:
Thank you very much for this bug report!
I'll release a bugfix version during the next days.
Sorry, something went wrong.
4936169
The new version is working nicely, thank you very much. 😃
mkarneim
No branches or pull requests
If a Pojo contains two fields with different types but with identical simple names the generated builder does not compile. Example Pojo to reproduce:
Generated builder:
The compiler complains about the import statements:
It would be nice if pojobuilder would support such Pojos.
Probably full qualified type names have to be used throughout the builder (for at least those duplicate types).
The text was updated successfully, but these errors were encountered: