Skip to content

Fix IndexOutOfBoundsException in SalesforceWideRecordReader when bulk… - #367

Merged
vikasrathee-cs merged 1 commit into
data-integrations:developfrom
Ashutosh-Jarvis:feature/fix-indexOutOfBoundExceptio-during-iteration
Oct 28, 2026
Merged

vikasrathee-cs merged 1 commit into
data-integrations:developfrom
Ashutosh-Jarvis:feature/fix-indexOutOfBoundExceptio-during-iteration

Conversation

@Ashutosh-Jarvis

Copy link
Copy Markdown
Contributor

check batchIterator.hasNext() before calling fetchBatchRecords() during SalesforceWideRecordReader.initialize() and default results to an empty list when no partitions exist, preventing an IndexOutOfBoundsException when the bulk query returns zero records.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates SalesforceWideRecordReader to check if the batch iterator has elements before fetching records, initializing the results to an empty list if none exist, and adds a corresponding unit test. Feedback suggests using Collections.emptyList() instead of new ArrayList<>() to avoid unnecessary allocations, simplifying the empty iterator type specification in the test, and replacing the deprecated internal Mockito FieldSetter with standard Java reflection.

@vikasrathee-cs
vikasrathee-cs force-pushed the feature/fix-indexOutOfBoundExceptio-during-iteration branch from d8832c5 to 39e1fe0 Compare October 27, 2026 06:26
… query returns empty results

Surface HTTP status and readable error message for non-JSON Salesforce OAuth responses
@Ashutosh-Jarvis
Ashutosh-Jarvis force-pushed the feature/fix-indexOutOfBoundExceptio-during-iteration branch from 4fbdd2b to 291c055 Compare October 28, 2026 06:28
@vikasrathee-cs
vikasrathee-cs merged commit a17e559 into data-integrations:develop Oct 28, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants