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

[BUG] @Builder.Default field is missing from class #3082

Closed
raiyni opened this issue Jan 4, 2022 · 1 comment
Closed

[BUG] @Builder.Default field is missing from class #3082

raiyni opened this issue Jan 4, 2022 · 1 comment

Comments

@raiyni
Copy link

raiyni commented Jan 4, 2022

Describe the bug
Adding @Builder.Default to a field causes it to not be in the builder class.

To Reproduce

@Builder
public class Something {
	
	@Builder.Default
	private List<String> args = new ArrayList<>();
	
	public static class SomethingBuilder {
		
		public SomethingBuilder args(String... str) {
			if (this.args == null) {
				// This field doesn't
				this.args = new ArrayList<>();
				
				// This field exists
				this.args$set = true;
			}
			return this;
		}
	}
}

Expected behavior
To be able to access the args variable in the builder class override.

Version info (please complete the following information):

  • openjdk 11.0.8
  • lombok 1.18.22
  • Eclipse but gradle doesn't compile it either.

Additional context
This worked in a previous version.

@raiyni
Copy link
Author

raiyni commented Jan 4, 2022

Ok. I guess I didn't read the patch notes deep enough #2115

@raiyni raiyni closed this as completed Jan 4, 2022
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