From 3b7edf4c3825ff2dd0da5b068ece9fee390b17a2 Mon Sep 17 00:00:00 2001 From: "minghua.xie" Date: Tue, 26 Nov 2024 14:42:30 +0800 Subject: [PATCH] version empty --- .../serializer/SerializerServiceLoader.java | 4 +++- .../serializer/seata/MultiVersionCodec.java | 19 +++++++++++++++++++ .../seata/MultiVersionCodecHelper.java | 16 ++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/seata/core/serializer/SerializerServiceLoader.java b/core/src/main/java/org/apache/seata/core/serializer/SerializerServiceLoader.java index 3a21d6f672d..af6e4d7e279 100644 --- a/core/src/main/java/org/apache/seata/core/serializer/SerializerServiceLoader.java +++ b/core/src/main/java/org/apache/seata/core/serializer/SerializerServiceLoader.java @@ -24,9 +24,11 @@ import org.apache.seata.common.loader.EnhancedServiceLoader; import org.apache.seata.common.loader.EnhancedServiceNotFoundException; import org.apache.seata.common.util.ReflectionUtil; +import org.apache.seata.common.util.StringUtils; import org.apache.seata.config.Configuration; import org.apache.seata.config.ConfigurationFactory; import org.apache.seata.core.constants.ConfigurationKeys; +import org.apache.seata.core.protocol.Version; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,7 +74,7 @@ public static Serializer load(SerializerType type, String version) throws Enhanc throw new EnhancedServiceNotFoundException("The class '" + PROTOBUF_SERIALIZER_CLASS_NAME + "' not found. " + "Please manually reference 'org.apache.seata:seata-serializer-protobuf' dependency."); } - + version = StringUtils.isBlank(version) ? Version.getCurrent() : version; String key = serializerKey(type, version); Serializer serializer = SERIALIZER_MAP.get(key); if (serializer == null) { diff --git a/serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/MultiVersionCodec.java b/serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/MultiVersionCodec.java index 704d6b35ff3..2374f0d0ecf 100644 --- a/serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/MultiVersionCodec.java +++ b/serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/MultiVersionCodec.java @@ -1,8 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.seata.serializer.seata; import java.util.Map; +/** + * interface MultiVersionCodec + */ public interface MultiVersionCodec { Map oldVersionCodec(); diff --git a/serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/MultiVersionCodecHelper.java b/serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/MultiVersionCodecHelper.java index 38024381fe5..a560e265e66 100644 --- a/serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/MultiVersionCodecHelper.java +++ b/serializer/seata-serializer-seata/src/main/java/org/apache/seata/serializer/seata/MultiVersionCodecHelper.java @@ -1,3 +1,19 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.seata.serializer.seata; import org.apache.seata.core.protocol.IncompatibleVersionException;