chaokunyang commented on code in PR #1932:
URL: https://github.com/apache/fury/pull/1932#discussion_r1833031574


##########
java/fury-core/src/main/java/org/apache/fury/serializer/NonexistentClassSerializers.java:
##########
@@ -208,23 +210,35 @@ public Object read(MemoryBuffer buffer) {
                     fury, refResolver, classResolver, fieldInfo, isFinal[i], 
buffer);
           }
         }
-        entries.add(new MapEntry(fieldInfo.qualifiedFieldName, fieldValue));
+        entries.add(new MapEntry(getFileName(fieldInfo.qualifiedFieldName, 
config), fieldValue));
       }
       for (ObjectSerializer.GenericTypeField fieldInfo : 
fieldsInfo.otherFields) {
         Object fieldValue = ObjectSerializer.readOtherFieldValue(fury, 
fieldInfo, buffer);
-        entries.add(new MapEntry(fieldInfo.qualifiedFieldName, fieldValue));
+        entries.add(new MapEntry(getFileName(fieldInfo.qualifiedFieldName, 
config), fieldValue));
       }
       Generics generics = fury.getGenerics();
       for (ObjectSerializer.GenericTypeField fieldInfo : 
fieldsInfo.containerFields) {
         Object fieldValue =
             ObjectSerializer.readContainerFieldValue(fury, generics, 
fieldInfo, buffer);
-        entries.add(new MapEntry(fieldInfo.qualifiedFieldName, fieldValue));
+        entries.add(new MapEntry(getFileName(fieldInfo.qualifiedFieldName, 
config), fieldValue));
       }
       obj.setEntries(entries);
       return obj;
     }
   }
 
+  public static String getFileName(String qualifiedFieldName, Config config) {
+    if (config.deserializeNonexistentClassNotWriteFullClassInfo()) {
+      int index = qualifiedFieldName.lastIndexOf(".");
+      if (index < 0) {
+        return qualifiedFieldName;
+      }
+      return qualifiedFieldName.substring(index + 1);

Review Comment:
   And we should skip duplicated field name in super class if this option is 
enabled



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to