SammyVimes commented on code in PR #2040:
URL: https://github.com/apache/ignite-3/pull/2040#discussion_r1191011924
##########
modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/messages/MessageImplGenerator.java:
##########
@@ -596,15 +610,27 @@ private static void
generateEqualsAndHashCode(TypeSpec.Builder messageImplBuilde
/**
* Creates a constructor for the current Network Message implementation.
*/
- private static MethodSpec constructor(List<FieldSpec> fields) {
+ private static MethodSpec constructor(List<FieldSpec> fields, Set<String>
notNullFieldNames, Set<String> marshallableFieldNames) {
MethodSpec.Builder constructor = MethodSpec.constructorBuilder()
.addModifiers(Modifier.PRIVATE);
- fields.forEach(field ->
- constructor
- .addParameter(field.type, field.name)
- .addStatement("this.$N = $N", field, field)
- );
+ fields.forEach(field -> {
+ String fieldName = field.name;
+
+ if (notNullFieldNames.contains(fieldName) &&
marshallableFieldNames.contains(fieldName)) {
Review Comment:
Everything but marshallable can be checked in the builder
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]