Skip to content
New issue

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

Inheritance is creating empty builder methods #79

Open
SvenBunge opened this issue Jun 19, 2024 · 1 comment
Open

Inheritance is creating empty builder methods #79

SvenBunge opened this issue Jun 19, 2024 · 1 comment

Comments

@SvenBunge
Copy link

SvenBunge commented Jun 19, 2024

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.

@mklemm
Copy link
Owner

mklemm commented Jun 20, 2024

The withXXX() without arguments is actually correct. What is wrong is that the superclass is missing it. These methods return a builder that can be used to build nested objects. But there is definitely something wrong here.

flaktack added a commit to realCity/jaxb-rich-contract-plugin that referenced this issue Sep 12, 2024
…ds (mklemm#79)

This allows for super() calls to be the same between inherited with*()
methods.
flaktack added a commit to realCity/jaxb-rich-contract-plugin that referenced this issue Sep 12, 2024
…ds (mklemm#79)

This allows for super() calls to be the same between inherited with*()
methods.
flaktack added a commit to realCity/jaxb-rich-contract-plugin that referenced this issue Sep 12, 2024
This allows for super() calls to compile using inherited with*() methods.
flaktack added a commit to realCity/jaxb-rich-contract-plugin that referenced this issue Sep 12, 2024
This allows for super() calls to compile using inherited with*() methods.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants