Uh oh!
There was an error while loading. Please reload this page.
Core: Make PlanTableScanResponse buider withCredentials replace instead of append - #17751
Core: Make PlanTableScanResponse buider withCredentials replace instead of append#17751dramaticlly wants to merge 1 commit into
Conversation
dramaticlly
commented
Aug 21, 2026
@singhpk234@nastra@huaxingao if you want to take a look |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| 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"); |
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)
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
| public Builder withCredentials(List<Credential> credentialsToAdd) { | ||
| credentials.addAll(credentialsToAdd); | ||
| public Builder withCredentials(List<Credential> newCredentials) { | ||
| Preconditions.checkArgument(null != newCredentials, "Invalid credentials: null"); |
There was a problem hiding this comment.
per
| Preconditions.checkArgument(null != newCredentials, "Invalid credentials: null"); | |
| Preconditions.checkArgument(newCredentials, "Invalid credentials list : null"); |
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1ed9d07 to
9f2604dCompare
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.