wernerdv commented on code in PR #12554:
URL: https://github.com/apache/ignite/pull/12554#discussion_r2622813578


##########
modules/codegen2/src/main/java/org/apache/ignite/internal/MessageSerializerGenerator.java:
##########
@@ -530,6 +592,30 @@ else if (assignableFrom(erasedType(type), 
type(Collection.class.getName()))) {
                     "MessageCollectionItemType." + 
messageCollectionItemType(typeArgs.get(0)));
             }
 
+            else if (enumType(type)) {
+                //TODO check CustomMapper annotation
+                String enumName = 
env.getTypeUtils().asElement(type).getSimpleName().toString();
+
+                char[] chars = enumName.toCharArray();
+                chars[0] = Character.toLowerCase(chars[0]);
+
+                String enumFieldPrefix = new String(chars);
+
+                CustomMapper custMapperAnn = 
field.getAnnotation(CustomMapper.class);

Review Comment:
   Maybe we can shorten it a bit?
   ```
                   boolean hasCustMapperAnn = 
field.getAnnotation(CustomMapper.class) != null;
   
                   String mapperCallStmnt = hasCustMapperAnn ? enumFieldPrefix 
+ "Mapper.decode" : "DefaultEnumMapper.INSTANCE.decode";
                   String enumValsFieldName = hasCustMapperAnn ? null : 
enumFieldPrefix + "Vals";
   ```



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