This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new cfe3bab Remove redundant code in
ServiceConfig#checkAndUpdateSubConfigs method (#8036)
cfe3bab is described below
commit cfe3bab6e4a9ea0073c5cf75cb2ee24e41131494
Author: 灼华 <[email protected]>
AuthorDate: Tue Jun 15 04:46:50 2021 -0500
Remove redundant code in ServiceConfig#checkAndUpdateSubConfigs method
(#8036)
* Remove redundant code in ServiceConfig#checkAndUpdateSubConfigs method
* Remove unused import
---
.../org/apache/dubbo/config/ServiceConfig.java | 32 +---------------------
1 file changed, 1 insertion(+), 31 deletions(-)
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
index 0afbf18..940c623 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ServiceConfig.java
@@ -23,7 +23,6 @@ import org.apache.dubbo.common.bytecode.Wrapper;
import org.apache.dubbo.common.extension.ExtensionLoader;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
-import org.apache.dubbo.common.utils.ClassUtils;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.ConfigUtils;
import org.apache.dubbo.common.utils.NamedThreadFactory;
@@ -294,36 +293,7 @@ public class ServiceConfig<T> extends ServiceConfigBase<T>
{
checkRef();
generic = FALSE_VALUE;
}
- if (local != null) {
- if (TRUE_VALUE.equals(local)) {
- local = interfaceName + LOCAL_SUFFIX;
- }
- Class<?> localClass;
- try {
- localClass =
ClassUtils.forNameWithThreadContextClassLoader(local);
- } catch (ClassNotFoundException e) {
- throw new IllegalStateException(e.getMessage(), e);
- }
- if (!interfaceClass.isAssignableFrom(localClass)) {
- throw new IllegalStateException(
- "The local implementation class " +
localClass.getName() + " not implement interface " + interfaceName);
- }
- }
- if (stub != null) {
- if (TRUE_VALUE.equals(stub)) {
- stub = interfaceName + STUB_SUFFIX;
- }
- Class<?> stubClass;
- try {
- stubClass =
ClassUtils.forNameWithThreadContextClassLoader(stub);
- } catch (ClassNotFoundException e) {
- throw new IllegalStateException(e.getMessage(), e);
- }
- if (!interfaceClass.isAssignableFrom(stubClass)) {
- throw new IllegalStateException(
- "The stub implementation class " + stubClass.getName()
+ " not implement interface " + interfaceName);
- }
- }
+
checkStubAndLocal(interfaceClass);
ConfigValidationUtils.checkMock(interfaceClass, this);
ConfigValidationUtils.validateServiceConfig(this);