From 852fbfd0ea52a0aa314ffd206d39bf47396f120a Mon Sep 17 00:00:00 2001 From: Yongqiang YANG Date: Wed, 19 Jun 2024 13:45:07 +0800 Subject: [PATCH] fix --- .../apache/doris/persist/gson/RuntimeTypeAdapterFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/persist/gson/RuntimeTypeAdapterFactory.java b/fe/fe-core/src/main/java/org/apache/doris/persist/gson/RuntimeTypeAdapterFactory.java index f67828d6767d7d3..ee780f0de1b95e7 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/persist/gson/RuntimeTypeAdapterFactory.java +++ b/fe/fe-core/src/main/java/org/apache/doris/persist/gson/RuntimeTypeAdapterFactory.java @@ -32,6 +32,7 @@ import com.google.gson.stream.JsonWriter; import java.io.IOException; +import java.lang.reflect.Modifier; import java.util.LinkedHashMap; import java.util.Map; @@ -282,7 +283,9 @@ public RuntimeTypeAdapterFactory registerCompatibleSubtype(Class } public TypeAdapter create(Gson gson, TypeToken type) { - if (!baseType.isAssignableFrom(type.getRawType()) && !subtypeToLabel.containsKey(type.getRawType())) { + if (baseType != type.getRawType() && !subtypeToLabel.containsKey(type.getRawType()) + && !(Modifier.isAbstract(type.getRawType().getModifiers()) + && baseType.isAssignableFrom(type.getRawType()))) { return null; }