Skip to content

Builder does not work for non-standard property name #244

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

Open
andriy-dmytruk opened this issue Jan 30, 2025 · 0 comments
Open

Builder does not work for non-standard property name #244

andriy-dmytruk opened this issue Jan 30, 2025 · 0 comments

Comments

@andriy-dmytruk
Copy link
Contributor

Expected Behavior

Create this class and define a builder for it:

@Builder(annotatedWith = {})
        public class Walrus {
           private String aBC;

           public Walrus(
                   String aBC
           ) {
               this.aBC = aBC;
           }

           public void getABC(String aBC) {
               this.aBC = aBC;
           }

        }

The builder should be created

Actual Behaviour

The error is:

java.lang.RuntimeException: test/Walrus.java:6: error: Failed to generate 'test.WalrusBuilder': Field 'aBC' is not available in [ClassDef{name='ClassName[name=test.WalrusBuilder, isInner=false, nullable=false]'}]:[]

Steps To Reproduce

https://github.com/micronaut-projects/micronaut-sourcegen/tree/andriy/builder-bug

Environment Information

No response

Example Application

No response

Version

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

1 participant