diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/MethodConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/MethodConfig.java index b52d7943914..84510418817 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/MethodConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/MethodConfig.java @@ -125,10 +125,29 @@ public MethodConfig() { public MethodConfig(Method method) { appendAnnotation(Method.class, method); + this.setReturn(method.isReturn()); - this.setOninvoke(method.oninvoke()); - this.setOnreturn(method.onreturn()); - this.setOnthrow(method.onthrow()); + + if(!"".equals(method.oninvoke())){ + this.setOninvoke(method.oninvoke()); + } + if(!"".equals(method.onreturn())){ + this.setOnreturn(method.onreturn()); + } + if(!"".equals(method.onthrow())){ + this.setOnthrow(method.onthrow()); + } + //if "" of @Method, then should set to null +// if("".equals(this.loadbalance)){ +// this.setLoadbalance(null); +// } +// if("".equals(this.cache)){ +// this.setLoadbalance(null); +// } +// if("".equals(this.validation)){ +// this.setValidation(null); +// } + if (method.arguments() != null && method.arguments().length != 0) { List argumentConfigs = new ArrayList(method.arguments().length); this.setArguments(argumentConfigs);