From 1c00226950219e01d4f2116682796250b51a5571 Mon Sep 17 00:00:00 2001 From: Jinho Lee <52993842+birariro@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:16:21 +0900 Subject: [PATCH] polishing FeignClientsRegistrar (#1038) * polishing feignClientsRegistrar * update the date in the license and add author --- .../cloud/openfeign/FeignClientsRegistrar.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientsRegistrar.java b/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientsRegistrar.java index 262c2c5e..03149a51 100644 --- a/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientsRegistrar.java +++ b/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientsRegistrar.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2022 the original author or authors. + * Copyright 2013-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -67,6 +67,7 @@ import org.springframework.util.StringUtils; * @author Marcin Grzejszczak * @author Olga Maciaszek-Sharma * @author Jasbir Singh + * @author Jinho Lee */ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar, ResourceLoaderAware, EnvironmentAware { @@ -321,11 +322,7 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar, ResourceLo validateFallbackFactory(annotation.getClass("fallbackFactory")); } - /* for testing */ String getName(Map attributes) { - return getName(null, attributes); - } - - String getName(ConfigurableBeanFactory beanFactory, Map attributes) { + String getName(Map attributes) { String name = (String) attributes.get("serviceId"); if (!StringUtils.hasText(name)) { name = (String) attributes.get("name"); @@ -333,7 +330,7 @@ class FeignClientsRegistrar implements ImportBeanDefinitionRegistrar, ResourceLo if (!StringUtils.hasText(name)) { name = (String) attributes.get("value"); } - name = resolve(beanFactory, name); + name = resolve(null, name); return getName(name); }