Skip to content

Conversation

@triceo
Copy link
Collaborator

@triceo triceo commented Dec 14, 2025

No description provided.

Copy link
Contributor

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 pull request refactors the automatic node-sharing API in the constraint stream score director to better control the sharing of node-shared classes. The key change is moving from a direct method call that builds node-shared constraint providers to a two-step process that allows callers to cache and reuse the node sharer instance.

Key Changes:

  • Replaced buildLambdaSharedConstraintProvider() method with a new createNodeSharer() method that returns a ConstraintProviderNodeSharer interface
  • Introduced the ConstraintProviderNodeSharer interface with a buildNodeSharedConstraintProvider() method for building node-shared constraint providers
  • Added documentation indicating that the ConstraintProviderNodeSharer should be cached to enable class reuse

Reviewed changes

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

File Description
core/src/main/java/ai/timefold/solver/core/enterprise/TimefoldSolverEnterpriseService.java Replaces the direct build method with a two-step API: creates a ConstraintProviderNodeSharer that can be cached, then builds node-shared constraint providers
core/src/main/java/ai/timefold/solver/core/impl/score/director/stream/BavetConstraintStreamScoreDirectorFactory.java Updates the call site to use the new two-step API for creating node-shared constraint providers

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

@sonarqubecloud
Copy link

@triceo triceo merged commit b469e95 into TimefoldAI:main Dec 15, 2025
40 checks passed
@triceo triceo deleted the nodeshare branch December 15, 2025 05:48
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.

2 participants