fix: mark ModelConvertor parameters and returns as non-null (#2507) - #2519
fix: mark ModelConvertor parameters and returns as non-null (#2507)#2519vikas-prasad-cx wants to merge 2 commits into
Conversation
|
Hi — gentle ping on this PR when you have a chance. Happy to address any feedback. CI may still need first-time contributor workflow approval. Thanks! |
|
Hello @vikas-prasad-cx - we are aware of your PR and we will get to it when time permits. |
rsynek
left a comment
There was a problem hiding this comment.
@vikas-prasad-cx Thanks for your contribution!
Also, my apologies for the delay with reviewing your PR.
I left one comment inline, plus, in order to declare non-null parameters of the ModelConvertor methods we must ensure that the caller never passes nulls there.
In case we don't have the ModelConfig instance, there is empty factory method.
|
@rsynek Thank you for the review, and no worries about the delay. Addressed in 8895be2:
Happy to adjust further if needed. |
…AI#2507) Clarify the API nullability contract with @NullMarked and enforce it in AbstractTrivialModelConvertor so callers cannot pass null arguments. Co-authored-by: Cursor <cursoragent@cursor.com>
…foldAI#2507) Drop the annotation-presence test and make SolverWorker use the empty factory when no model config is available, so convertor callers never pass a null ModelConfig. Co-authored-by: Cursor <cursoragent@cursor.com>
8895be2 to
4275784
Compare
Thank you, looks very good now! I will take care of the CI checks and let you if any further change is needed. |
Summary
ModelConvertorwith@NullMarkedand document that method parameters/returns are never null (use emptyOptionalfor no prior output).AbstractTrivialModelConvertorwith the same contract via runtimeObjects.requireNonNullchecks, removing the previous null-tolerantmodelOutputpath.Fixes #2507
Test plan
./mvnw test -pl service/definition -Dtest=ModelConvertorNullabilityTest./mvnw test -pl service/quarkus/deployment -Dtest=AbstractTrivialModelConvertorTest./mvnw test -pl service/definition,service/quarkus/deployment(40 tests passed)Made with Cursor