Skip to content

Use Integer.compare at ServicePriority#compareTo - #1799

Merged
fjtirado merged 1 commit into
open-workflow-specification:mainfrom
mathecruz:issue-1797
Oct 23, 2026
Merged

fjtirado merged 1 commit into
open-workflow-specification:mainfrom
mathecruz:issue-1797

Conversation

@mathecruz

Copy link
Copy Markdown
Collaborator

Many thanks for submitting your Pull Request ❤️!

What this PR does / why we need it:

Special notes for reviewers:

Additional information (if needed):

Closes #1797

Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 19:31
@mathecruz
mathecruz requested a review from fjtirado as a code owner October 22, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused change fixes comparator overflow while preserving the intended priority ordering, with no unresolved findings.

No open issues 🎉

What changed in this PR

Fixes #1797 by making the shared service-priority comparator safe from integer overflow, ensuring WorkflowUtils.loadFirst selects implementations in the intended priority order.

Changes:

  • Replaces subtraction with Integer.compare, preserving ascending ordering across the full integer range.
File Description
impl/​core/​src/​main/​java/​org/​openworkflow/​sdk/​impl/​ServicePriority.java Uses overflow-safe comparison in compareTo.

Review effort: Balanced

@fjtirado
fjtirado merged commit 4a9ffd8 into open-workflow-specification:main Oct 23, 2026
4 checks passed
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.

Priority comparator overflow in ServicePriority

3 participants