anton-vinogradov commented on code in PR #12677:
URL: https://github.com/apache/ignite/pull/12677#discussion_r2755129931


##########
modules/codegen2/src/main/java/org/apache/ignite/internal/idto/IDTOSerializerGenerator.java:
##########
@@ -85,22 +98,34 @@ public class IDTOSerializerGenerator {
         TYPE_SERDES.put(float.class.getName(), 
F.t("out.writeFloat(obj.${f});", "obj.${f} = in.readFloat();"));
         TYPE_SERDES.put(double.class.getName(), 
F.t("out.writeDouble(obj.${f});", "obj.${f} = in.readDouble();"));
 
-        IgniteBiTuple<String, String> objSerdes = 
F.t("out.writeObject(obj.${f});", "obj.${f} = (${c})in.readObject();");
-
-        TYPE_SERDES.put(Boolean.class.getName(), objSerdes);
-        TYPE_SERDES.put(Byte.class.getName(), objSerdes);
-        TYPE_SERDES.put(Short.class.getName(), objSerdes);
-        TYPE_SERDES.put(Integer.class.getName(), objSerdes);
-        TYPE_SERDES.put(Long.class.getName(), objSerdes);
-        TYPE_SERDES.put(Float.class.getName(), objSerdes);
-        TYPE_SERDES.put(Double.class.getName(), objSerdes);
+        TYPE_SERDES.put(Boolean.class.getName(), OBJECT_SERDES);
+        TYPE_SERDES.put(Byte.class.getName(), OBJECT_SERDES);
+        TYPE_SERDES.put(Short.class.getName(), OBJECT_SERDES);
+        TYPE_SERDES.put(Integer.class.getName(), OBJECT_SERDES);
+        TYPE_SERDES.put(Long.class.getName(), OBJECT_SERDES);
+        TYPE_SERDES.put(Float.class.getName(), OBJECT_SERDES);
+        TYPE_SERDES.put(Double.class.getName(), OBJECT_SERDES);
+        TYPE_SERDES.put(Throwable.class.getName(), OBJECT_SERDES);
+        TYPE_SERDES.put(Exception.class.getName(), OBJECT_SERDES);
+        TYPE_SERDES.put(Object.class.getName(), OBJECT_SERDES);
 
         TYPE_SERDES.put(String.class.getName(), F.t("U.writeString(out, 
obj.${f});", "obj.${f} = U.readString(in);"));
         TYPE_SERDES.put(UUID.class.getName(), F.t("U.writeUuid(out, 
obj.${f});", "obj.${f} = U.readUuid(in);"));
         TYPE_SERDES.put("org.apache.ignite.lang.IgniteUuid", 
F.t("U.writeIgniteUuid(out, obj.${f});", "obj.${f} = U.readIgniteUuid(in);"));
-        
TYPE_SERDES.put("org.apache.ignite.internal.processors.cache.version.GridCacheVersion",
 objSerdes);
-
+        
TYPE_SERDES.put("org.apache.ignite.internal.processors.cache.version.GridCacheVersion",
 OBJECT_SERDES);
+        TYPE_SERDES.put("org.apache.ignite.lang.IgniteProductVersion", 
OBJECT_SERDES);
+        TYPE_SERDES.put("org.apache.ignite.internal.binary.BinaryMetadata", 
OBJECT_SERDES);
+        
TYPE_SERDES.put("org.apache.ignite.internal.management.cache.PartitionKey", 
OBJECT_SERDES);
+        
TYPE_SERDES.put("org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion",
 OBJECT_SERDES);
+        TYPE_SERDES.put("org.apache.ignite.cache.CacheMode",
+            F.t("out.writeByte(CacheMode.toCode(obj.${f}));", "obj.${f} = 
CacheMode.fromCode(in.readByte());"));
+
+        TYPE_SERDES.put(TreeMap.class.getName(), F.t("U.writeMap(out, 
obj.${f});", "obj.${f} = U.readTreeMap(in);"));

Review Comment:
   How about to write classname or specify type at annotation instead of 
changing the type of the field to TreeMap?
   



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