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


##########
java/fory-core/src/main/java/org/apache/fory/resolver/ClassResolver.java:
##########
@@ -1802,15 +1794,6 @@ public void ensureSerializersCompiled() {
               }
             }
           });
-      if (GraalvmSupport.isGraalBuildtime()) {
-        classInfoMap.forEach(
-            (cls, classInfo) -> {
-              if (classInfo.serializer != null
-                  && !extRegistry.initialClassInfos.contains(classInfo)) {
-                classInfo.serializer = null;

Review Comment:
   Actually we do need the clear, otherwise current Fory instance may hold some 
unexpected serializer. For example, `ObjectStreamSerializer` hold 
CompatibleSerializer serializer instead of generated by Fory.
   
   ```java
         if (GraalvmSupport.isGraalBuildtime()) {
           // trigger serializer constructor method handle generate.
           Serializers.newSerializer(fory, type, sc);
         }
         if (sc == CompatibleSerializer.class || 
GraalvmSupport.isGraalBuildtime()) {
           // skip init generated serializer at graalvm build time
           this.slotsSerializer = new CompatibleSerializer(fory, type, 
fieldResolver);
         } else {
           this.slotsSerializer = (CompatibleSerializerBase) 
Serializers.newSerializer(fory, type, sc);
         }
   ```



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