nizhikov commented on code in PR #13461:
URL: https://github.com/apache/ignite/pull/13461#discussion_r3759186278


##########
modules/codegen/src/main/java/org/apache/ignite/internal/MessageMarshallerGenerator.java:
##########
@@ -1156,18 +1156,78 @@ private enum MarshalledKind {
             return null;
         }
 
+        MarshalledKind res;
+
         if (map)
-            return MarshalledKind.MAP;
+            res = MarshalledKind.MAP;
+        else {
+            TypeMirror wire = requireEnclosed(enclosed, ann.value(), 
"@Marshalled").asType();
+
+            if (wire.getKind() == TypeKind.ARRAY) {
+                res = ((ArrayType)wire).getComponentType().getKind() == 
TypeKind.BYTE
+                    ? MarshalledKind.BLOB
+                    : MarshalledKind.ELEMENTS;
+            }
+            else
+                res = MarshalledKind.ELEMENT_BLOBS;
+        }
+
+        /*
+         * Ensures that field annotated with {@link Marshalled} doesn't 
perform {@code Message} -> {@code byte[]} transformation
+         * which escapes {@link Order} and other rules implemented on top of 
communication {@code MessageWriter, MessageReader} logic.
+         */
+        if (foundMessageToBytesTransformation(field.asType(), field, ann)) {
+            env.getMessager().printMessage(Diagnostic.Kind.ERROR,
+                "Message must be written by dedicated message serializers. " +
+                    "Remove @" + Marshalled.class.getSimpleName() + " 
annotation and remove companion field.", field);

Review Comment:
   Done.



-- 
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]

Reply via email to