Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,13 @@ private int buildUserTypeId(Class<?> cls, Serializer<?> serializer) {

@Override
protected int buildUnregisteredTypeId(Class<?> cls, Serializer<?> serializer) {
if (serializer == null && !cls.isEnum() && useReplaceResolveSerializer(cls)) {
return Types.NAMED_EXT;
if (!cls.isEnum()) {
if (serializer instanceof ReplaceResolveSerializer) {
return REPLACE_STUB_ID;
}
if (serializer == null && useReplaceResolveSerializer(cls)) {
return Types.NAMED_EXT;
}
}
return super.buildUnregisteredTypeId(cls, serializer);
}
Expand Down Expand Up @@ -1215,7 +1220,11 @@ public void addSerializer(Class<?> type, Serializer<?> serializer) {
} else {
typeInfo = typeInfo.copy(typeId);
}
updateTypeInfo(type, typeInfo);
if (typeId == REPLACE_STUB_ID) {
classInfoMap.put(type, typeInfo);
} else {
updateTypeInfo(type, typeInfo);
}
// Add to compositeNameBytes2TypeInfo for unregistered classes so that
// readTypeInfo can find the TypeInfo by name bytes during deserialization.
// This is important for dynamically created classes that can't be loaded by name.
Expand Down
Loading
Loading