Decrease Java model priority#1239
Conversation
There was a problem hiding this comment.
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()inJavaModelFactoryto return a lower-preference value than the default, so it loses toJacksonModelFactorywhen 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.
experimental/model/src/main/java/io/serverlessworkflow/impl/model/func/JavaModelFactory.java
Show resolved
Hide resolved
128583f to
ac65272
Compare
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>
ac65272 to
4215163
Compare
There was a problem hiding this comment.
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 thanJacksonModelFactorywhen both are discoverable viaServiceLoader.
💡 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; |
This way when both jackson model and java model are in the classpath, the jackson model will take preference.