Hen1ng commented on code in PR #2036:
URL: https://github.com/apache/fury/pull/2036#discussion_r2051677074


##########
java/fury-core/src/main/java/org/apache/fury/serializer/ObjectSerializer.java:
##########
@@ -495,104 +548,165 @@ static boolean writePrimitiveFieldValueFailed(
    * @return true if field value isn't written by this function.
    */
   static boolean writeBasicObjectFieldValueFailed(
-      Fury fury, MemoryBuffer buffer, Object fieldValue, short classId) {
+      Fury fury,
+      MemoryBuffer buffer,
+      Object fieldValue,
+      short classId,
+      FuryFieldAnnotationInfo fieldAnnotationInfo) {
     if (!fury.isBasicTypesRefIgnored()) {
       return true; // let common path handle this.
     }
+    boolean nullable = fieldAnnotationInfo.nullable;
     // add time types serialization here.
     switch (classId) {
-      case ClassResolver.STRING_CLASS_ID: // fastpath for string.
-        fury.writeJavaStringRef(buffer, (String) (fieldValue));
+      case ClassResolver.STRING_CLASS_ID: // fast path for string.
+        fury.writeNullableJavaStringRef(buffer, (String) (fieldValue), 
nullable);

Review Comment:
   Call fury.writeString(buffer, v) separately; This method will ignore the 
case that stringSerializer.needToWriteRef() is true, resulting in this 
refResolver.writeRefOrNull(buffer, str) method not being called. Is this as 
expected?



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