tkalkirill commented on code in PR #4152:
URL: https://github.com/apache/ignite-3/pull/4152#discussion_r1697102589
##########
modules/network-annotation-processor/src/main/java/org/apache/ignite/internal/network/processor/serialization/MessageSerializerGenerator.java:
##########
@@ -140,19 +144,25 @@ private MethodSpec writeMessageMethod(MessageClass
message) {
return method.build();
}
- /**
- * Helper method for resolving a {@link MessageWriter} "write*" call based
on the message field type.
- */
+ /** Helper method for resolving a {@link MessageWriter} "write*" call
based on the message field type. */
private CodeBlock writeMessageCodeBlock(ExecutableElement getter) {
- var methodResolver = new
MessageWriterMethodResolver(processingEnvironment);
-
- CodeBlock writerMethodCall = CodeBlock.builder()
- .add("boolean written = writer.")
- .add(methodResolver.resolveWriteMethod(getter))
- .build();
+ CodeBlock.Builder writerMethodCallBuilder = CodeBlock.builder();
+
+ if (typeUtils.isEnum(getter.getReturnType())) {
+ String fieldName = getter.getSimpleName().toString();
+
+ writerMethodCallBuilder
+ .add("int ordinal = message.$L() == null ? 0 :
message.$L().ordinal() + 1;", fieldName, fieldName)
Review Comment:
Try to fix it.
--
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]