Core: Make PlanTableScanResponse buider withCredentials replace instead of append - #17751
Open
dramaticlly wants to merge 1 commit into
Open
Core: Make PlanTableScanResponse buider withCredentials replace instead of append#17751dramaticlly wants to merge 1 commit into
dramaticlly wants to merge 1 commit into
Conversation
Contributor
Author
|
@singhpk234 @nastra @huaxingao if you want to take a look |
nastra
reviewed
Aug 21, 2026
nastra
reviewed
Aug 21, 2026
nastra
reviewed
Aug 21, 2026
| credentials.addAll(credentialsToAdd); | ||
| public Builder withCredentials(List<Credential> newCredentials) { | ||
| Preconditions.checkArgument(null != newCredentials, "Invalid credentials list: null"); | ||
| Preconditions.checkArgument(!newCredentials.contains(null), "Invalid credential: null"); |
Contributor
There was a problem hiding this comment.
do we actually need this check? We should get this for free when doing this.credentials = ImmutableList.copyOf(credentialsToAdd)
Contributor
Author
There was a problem hiding this comment.
I think ImmutableList.copyOf(credentialsToAdd) will throw NPE instead of IllegalArgumentException instead, from AGENTS.md seem to favor "Preconditions.checkArgument over NPE"
and I saw we have some precedence in
singhpk234
reviewed
Aug 28, 2026
| public Builder withCredentials(List<Credential> credentialsToAdd) { | ||
| credentials.addAll(credentialsToAdd); | ||
| public Builder withCredentials(List<Credential> newCredentials) { | ||
| Preconditions.checkArgument(null != newCredentials, "Invalid credentials: null"); |
Contributor
There was a problem hiding this comment.
per
Suggested change
| Preconditions.checkArgument(null != newCredentials, "Invalid credentials: null"); | |
| Preconditions.checkArgument(newCredentials, "Invalid credentials list : null"); |
Contributor
Author
There was a problem hiding this comment.
Thanks @singhpk234 , I think ListTableResponse is relative old (merged Feb 2022) compare to the latest agents.md guideline in
Line 121 in f80a72f
dramaticlly
force-pushed
the
builder-credentials-replace-semantics
branch
from
August 28, 2026 17:20
1ed9d07 to
9f2604d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up of #17638 (comment) with changes in
PlanTableScanResponse.BuilderandFetchPlanningResultResponse.BuilderwithCredentials(List<Credential>)now replaces the builder's credentials instead of appending to them.nulllist andnullelements as the follow up of Core: Add storage credentials to FetchPlanningResultResponse #14994 (comment)build()now passesImmutableList.copyOf(credentials)instead of the builder's liveArrayList.AI Disclosure
withCredentialsappend-vs-replace question raised in review of Core: Reduce visibility on scan planning response builder for specsById and deleteFiles #17638.