Skip to content

fix: mark ModelConvertor parameters and returns as non-null (#2507)#2519

Open
vikas-prasad-cx wants to merge 1 commit into
TimefoldAI:mainfrom
vikas-prasad-cx:timefold-first-contribution
Open

fix: mark ModelConvertor parameters and returns as non-null (#2507)#2519
vikas-prasad-cx wants to merge 1 commit into
TimefoldAI:mainfrom
vikas-prasad-cx:timefold-first-contribution

Conversation

@vikas-prasad-cx

Copy link
Copy Markdown

Summary

  • Mark ModelConvertor with @NullMarked and document that method parameters/returns are never null (use empty Optional for no prior output).
  • Align AbstractTrivialModelConvertor with the same contract via runtime Objects.requireNonNull checks, removing the previous null-tolerant modelOutput path.
  • Add unit tests covering the annotation contract and null-argument rejection.

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)
  • CI checks on this PR

Made with Cursor

…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>
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.

ModelConvertor interface should guarantee its method parameters cannot be null

1 participant