You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "SammyVimes (via GitHub)" <gi...@apache.org> on 2023/05/11 11:14:50 UTC

[GitHub] [ignite-3] SammyVimes commented on a diff in pull request #2040: IGNITE-19437 Add nullability checks for generated messages

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: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org