chaokunyang commented on code in PR #2917:
URL: https://github.com/apache/fory/pull/2917#discussion_r2534534095


##########
java/fory-core/src/main/java/org/apache/fory/resolver/ClassResolver.java:
##########
@@ -896,7 +899,11 @@ public Class<? extends Serializer> 
getSerializerClass(Class<?> cls, boolean code
         return Serializers.CharsetSerializer.class;
       } else if (ReflectionUtils.isJdkProxy(cls)) {
         if (JavaSerializer.getWriteReplaceMethod(cls) != null) {
-          return ReplaceResolveSerializer.class;
+          if (!fory.isCompatible() && !fory.isShareMeta() && 
Modifier.isFinal(cls.getModifiers())) {
+            return FinalFieldReplaceResolveSerializer.class;

Review Comment:
   `FinalFieldReplaceResolveSerializer` can only be used for field serializer, 
and `getSerializerClass` is used for non-field object serialization too. 
   
   Another thing is that this change make all tests pass, it should not. We may 
need add a test to cover this



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