jaxb2-rich-contract-plugin icon indicating copy to clipboard operation
jaxb2-rich-contract-plugin copied to clipboard

Calls of .clone() are not casted to needed object

Open SvenBunge opened this issue 8 months ago • 0 comments

Tried to generate a builder with another xsd set with the flags -Ximmutable and -Xfluent-builder and it is generating methods using the .clone() method but without casting the result before assigning it to the specific variable:

    public<_B >void copyTo(final Hochbaustatistik.Builder<_B> _other) {
        _other.ordnungsnummer = this.ordnungsnummer;
        _other.identifikator = this.identifikator;
        _other.strassenschluessel = this.strassenschluessel;
        _other.haustypWohngebaeude = ((this.haustypWohngebaeude == null)?null:this.haustypWohngebaeude.newCopyBuilder(_other));
        _other.bauabgang = ((this.bauabgang == null)?null:this.bauabgang.newCopyBuilder(_other));
        _other.bauueberhang = ((this.bauueberhang == null)?null:this.bauueberhang.newCopyBuilder(_other));
        _other.baufertigstellung = ((this.baufertigstellung == null)?null:this.baufertigstellung.clone());
        _other.baugenehmigung = ((this.baugenehmigung == null)?null:this.baugenehmigung.newCopyBuilder(_other));
        _other.heizenergie = ((this.heizenergie == null)?null:this.heizenergie.clone());
....

Still using 4.2.0.0 with jaxb-maven-plugin 4.0.6

SvenBunge avatar Jun 19 '24 21:06 SvenBunge