Skip to content

Decrease Java model priority#1239

Merged
fjtirado merged 1 commit intoserverlessworkflow:mainfrom
fjtirado:set_java_model_priority
Mar 17, 2026
Merged

Decrease Java model priority#1239
fjtirado merged 1 commit intoserverlessworkflow:mainfrom
fjtirado:set_java_model_priority

Conversation

@fjtirado
Copy link
Copy Markdown
Collaborator

This way when both jackson model and java model are in the classpath, the jackson model will take preference.

Copilot AI review requested due to automatic review settings March 17, 2026 18:26
Copy link
Copy Markdown
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

Adjusts service selection precedence so that when both the Jackson-based model and the Java-based model are available on the classpath, the Jackson model factory is selected first (via ServicePriority sorting).

Changes:

  • Override priority() in JavaModelFactory to return a lower-preference value than the default, so it loses to JacksonModelFactory when both are present.

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

You can also share your feedback on Copilot code review. Take the survey.

@fjtirado fjtirado force-pushed the set_java_model_priority branch from 128583f to ac65272 Compare March 17, 2026 18:30
This way when both jackson model and java model are in the classpath,
the jackson model will take preference.

Signed-off-by: fjtirado <ftirados@redhat.com>
Copilot AI review requested due to automatic review settings March 17, 2026 18:32
@fjtirado fjtirado force-pushed the set_java_model_priority branch from ac65272 to 4215163 Compare March 17, 2026 18:32
@fjtirado fjtirado merged commit fc115ae into serverlessworkflow:main Mar 17, 2026
6 checks passed
Copy link
Copy Markdown
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 PR adjusts service selection precedence so that when multiple WorkflowModelFactory implementations are present on the classpath, the Jackson-based model is preferred over the Java-object model.

Changes:

  • Override JavaModelFactory.priority() to return a lower-precedence value than the default, making it less preferred than JacksonModelFactory when both are discoverable via ServiceLoader.

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

You can also share your feedback on Copilot code review. Take the survey.


@Override
public int priority() {
return DEFAULT_PRIORITY + 10;
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