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


##########
java/fory-core/src/main/java/org/apache/fory/Fory.java:
##########
@@ -226,18 +229,24 @@ public void registerUnion(
   @Override
   public <T> void registerSerializer(Class<T> type, Class<? extends 
Serializer> serializerClass) {
     getTypeResolver().registerSerializer(type, serializerClass);
+    this.configHash = Objects.hashCode(configHash, type, serializerClass);
   }
 
   @Override
   public void registerSerializer(Class<?> type, Serializer<?> serializer) {
     getTypeResolver().registerSerializer(type, serializer);
+    this.configHash = Objects.hashCode(configHash, type, 
serializer.getClass());
   }
 
   @Override
   public void registerSerializer(Class<?> type, Function<Fory, Serializer<?>> 
serializerCreator) {

Review Comment:
   Only the two direct `registerSerializer` overloads update `configHash`. The 
`Function` overload here, both `registerSerializerAndType` overloads below, and 
the `registerUnion` overloads above still bypass that update, so two `Fory` 
instances that differ only through those APIs can still reuse the same 
generated serializer classes. If the goal is to isolate codegen by 
post-construction registration state, those entry points need to participate 
too.



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