Skip to content

Comments

[Review] fix: Move assigning default values from builder constructor to build() method (box/box-codegen#922)#1

Open
govambam wants to merge 1 commit intobase-for-pr-1716from
review-pr-1716
Open

[Review] fix: Move assigning default values from builder constructor to build() method (box/box-codegen#922)#1
govambam wants to merge 1 commit intobase-for-pr-1716from
review-pr-1716

Conversation

@govambam
Copy link
Owner

Recreated from box#1716 for Macroscope review.

Original PR: box#1716
Status: closed (merged)

Recreated using squash merge commit - exact merged state preserved.

Original PR: box#1716

@macroscopeapp
Copy link

macroscopeapp bot commented Feb 17, 2026

Move default assignments from Builder constructors to build() across SDK headers, managers, and schemas to apply lazy defaults for fields like extraHeaders, networkSession, boxVersion, and type

Shift defaulting logic from constructors to build() in builders and add null-guarded defaults in schemas. Builders now lazily initialize extraHeaders, networkSession, and version headers during build(), and schema classes guard enum type and similar fields with null checks. Retry strategy builder fields switch to boxed types with defaults applied at build() (e.g., maxAttempts=5, retryRandomizationFactor=0.5d, retryBaseInterval=1d, maxRetriesOnException=2).

📍Where to Start

Start with the pattern change in the retry builder at BoxRetryStrategy.Builder.build() in BoxRetryStrategy.java, then review a representative manager/header builder pair such as DownloadsManager.Builder.build() in DownloadsManager.java and DownloadFileHeaders.Builder.build() in DownloadFileHeaders.java.


Macroscope summarized 9994513.

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

Successfully merging this pull request may close these issues.

1 participant