Skip to content

Conversation

@rjrudin
Copy link
Contributor

@rjrudin rjrudin commented Jan 5, 2026

Made QueryConfig into a record so it's immutable, making it easier to understand. And passing it to the constructor of QueryBatcherImpl instead of having 6 separate args.

Copilot AI review requested due to automatic review settings January 5, 2026 15:40
@github-actions
Copy link

github-actions bot commented Jan 5, 2026

Copyright Validation Results
Total: 4 | Passed: 4 | Failed: 0 | Skipped: 0 | at: 2026-01-05 15:46:06 UTC | commit: 831ecdc

✅ Valid Files

  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/impl/DataMovementManagerImpl.java
  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/impl/DataMovementServices.java
  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/impl/QueryBatcherImpl.java
  • marklogic-client-api/src/main/java/com/marklogic/client/datamovement/impl/QueryConfig.java

✅ All files have valid copyright headers!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the QueryConfig class from a mutable inner class to an immutable record, improving code clarity and maintainability. The refactoring consolidates multiple constructor parameters into a single QueryConfig object.

Key changes:

  • Converted QueryConfig from an inner class with public fields to a top-level immutable record
  • Simplified QueryBatcherImpl constructor by accepting a single QueryConfig parameter instead of 6 individual parameters
  • Restructured the initConfig method to construct QueryConfig using local variables before instantiation

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
QueryConfig.java New record definition with 6 fields replacing the previous inner class
QueryBatcherImpl.java Updated constructor to accept QueryConfig object and extract values from it
DataMovementServices.java Refactored initConfig to build QueryConfig record; removed inner class definition
DataMovementManagerImpl.java Updated to pass QueryConfig object to QueryBatcherImpl constructor; removed unused import

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

this.queryMethod = "POST";
this.query = queryMgr.newRawCtsQueryDefinition(new StringHandle(serializedCtsQuery).withFormat(Format.JSON));
this.originalQuery = originalQuery;
this.filtered = queryConfig.filtered();
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The filtered field is being assigned the value from queryConfig.filtered() which can be null (Boolean object), but the previous code had a null check. If filtered is null, this could cause unexpected behavior. Consider preserving the null check: if (queryConfig.filtered() != null) { this.filtered = queryConfig.filtered(); }

Suggested change
this.filtered = queryConfig.filtered();
if (queryConfig.filtered() != null) {
this.filtered = queryConfig.filtered();
}

Copilot uses AI. Check for mistakes.
Made QueryConfig into a record so it's immutable, making it easier to understand. And passing it to the constructor of QueryBatcherImpl instead of having 6 separate args.
@rjrudin rjrudin force-pushed the feature/1872-github branch from 2460b7a to 831ecdc Compare January 5, 2026 15:45
@rjrudin rjrudin merged commit 1cf5789 into develop Jan 5, 2026
3 checks passed
@rjrudin rjrudin deleted the feature/1872-github branch January 5, 2026 16:22
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.

3 participants