feat!: Convert spec classes to records#889
Conversation
There was a problem hiding this comment.
Code Review
This pull request performs a significant refactoring of the v0.3 compatibility layer, primarily converting domain objects like Task, Message, and various SecurityScheme implementations from standard classes to Java records. This change necessitates updating method calls from getter-style to accessor-style across the entire module, including transport layers and test suites. The refactor also includes converting Part_v0_3 into a sealed interface, updating serialization logic in JsonUtil_v0_3, and adding no-args constructors to specific handlers to maintain CDI compliance. I have no feedback to provide as there were no review comments to assess.
cd34a4e to
352614a
Compare
This became apparent since in non-Quarkus environments you have to set a bunch of JVM flags, and also introduce default constructors, which in turn means making fields non-final. Additionally, added default constructors for some CDI beans to work in stricter CDI environments than Quarkus
| this.text = text; | ||
| this.metadata = metadata; | ||
| this.kind = Kind.TEXT; | ||
| if (kind == null) { |
There was a problem hiding this comment.
You can't set a record field in the canonical constructor
| Assert.checkNotNullParam("kind", kind); | ||
| if (! kind.equals(STATUS_UPDATE)) { | ||
| if (kind == null) { | ||
| kind = KIND; |
There was a problem hiding this comment.
You can't set a record field in the canonical constructor
| Assert.checkNotNullParam("kind", kind); | ||
| if (! kind.equals(ARTIFACT_UPDATE)) { | ||
| if (kind == null) { | ||
| kind = KIND; |
There was a problem hiding this comment.
You can't set a record field in the canonical constructor
| Assert.checkNotNullParam("kind", kind); | ||
| if (! kind.equals(TASK)) { | ||
| if (kind == null) { | ||
| kind = KIND; |
There was a problem hiding this comment.
You can't set a record field in the canonical constructor
Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
Fixing the constructors
|
Thanks @kabir |
This became apparent since in non-Quarkus environments you have to set a bunch of JVM flags, and also introduce default constructors, which in turn means making fields non-final.
Additionally, added default constructors for some CDI beans to work in stricter CDI environments than Quarkus