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

Inheritance is creating empty builder methods

Open SvenBunge opened this issue 8 months ago • 1 comments

Great plugin. Switched from Jaxb3 to jaxb4 by switching from cxf to jaxb maven plugin. Trying to compile the big xsd set xbau 2.3.1 with 4.2.0.0 using jaxb-maven-plugin 4.0.6 and -Xfluent-builder and -Ximmutable

But is creating some builder methods like:

        public Baulast.BeteiligteGrundstuecke.Builder<? extends BaulastErweitert.Builder<_B>> withBeteiligteGrundstuecke() {
            return ((Baulast.BeteiligteGrundstuecke.Builder<? extends BaulastErweitert.Builder<_B>> ) super.withBeteiligteGrundstuecke());
        }

in addition to the correct ones:

        @Override
        public BaulastErweitert.Builder<_B> withBeteiligtePersonen(final Baulast.BeteiligtePersonen beteiligtePersonen) {
            super.withBeteiligtePersonen(beteiligtePersonen);
            return this;
        }

This is leading to compile issues because the super method withBeteiligteGrundstuecke expects an object.

Seems I can avoid this behavior with

                            <arg>-fluent-builder.narrow=y</arg>
                            <arg>-fluent-builder.copyPartial=y</arg>

With 2.x we had no issues so far.

SvenBunge avatar Jun 19 '24 20:06 SvenBunge