Skip to content
Permalink
Browse files
Remove unnecessary null check.
  • Loading branch information
ralf0131 committed May 17, 2018
1 parent 6db0cd1 commit 00b63119139f09462aa62f4d43c40c949cb785a0
Showing 1 changed file with 6 additions and 6 deletions.
@@ -122,19 +122,19 @@ private static void checkAndConvertImplicitConfig(MethodConfig method, Map<Strin
//convert onreturn methodName to Method
String onReturnMethodKey = StaticContext.getKey(map, method.getName(), Constants.ON_RETURN_METHOD_KEY);
Object onReturnMethod = attributes.get(onReturnMethodKey);
if (onReturnMethod != null && onReturnMethod instanceof String) {
if (onReturnMethod instanceof String) {
attributes.put(onReturnMethodKey, getMethodByName(method.getOnreturn().getClass(), onReturnMethod.toString()));
}
//convert onthrow methodName to Method
String onThrowMethodKey = StaticContext.getKey(map, method.getName(), Constants.ON_THROW_METHOD_KEY);
Object onThrowMethod = attributes.get(onThrowMethodKey);
if (onThrowMethod != null && onThrowMethod instanceof String) {
if (onThrowMethod instanceof String) {
attributes.put(onThrowMethodKey, getMethodByName(method.getOnthrow().getClass(), onThrowMethod.toString()));
}
//convert oninvoke methodName to Method
String onInvokeMethodKey = StaticContext.getKey(map, method.getName(), Constants.ON_INVOKE_METHOD_KEY);
Object onInvokeMethod = attributes.get(onInvokeMethodKey);
if (onInvokeMethod != null && onInvokeMethod instanceof String) {
if (onInvokeMethod instanceof String) {
attributes.put(onInvokeMethodKey, getMethodByName(method.getOninvoke().getClass(), onInvokeMethod.toString()));
}
}
@@ -148,7 +148,7 @@ private static Method getMethodByName(Class<?> clazz, String methodName) {
}

public URL toUrl() {
return urls == null || urls.isEmpty() ? null : urls.iterator().next();
return urls.isEmpty() ? null : urls.iterator().next();
}

public List<URL> toUrls() {
@@ -238,7 +238,7 @@ private void init() {
if (resolve != null && resolve.length() > 0) {
url = resolve;
if (logger.isWarnEnabled()) {
if (resolveFile != null && resolveFile.length() > 0) {
if (resolveFile != null) {
logger.warn("Using default dubbo resolve file " + resolveFile + " replace " + interfaceName + "" + resolve + " to p2p invoke remote service.");
} else {
logger.warn("Using -D" + interfaceName + "=" + resolve + " to p2p invoke remote service.");
@@ -385,7 +385,7 @@ private T createProxy(Map<String, String> map) {
urls.add(u.addParameterAndEncoded(Constants.REFER_KEY, StringUtils.toQueryString(map)));
}
}
if (urls == null || urls.isEmpty()) {
if (urls.isEmpty()) {
throw new IllegalStateException("No such any registry to reference " + interfaceName + " on the consumer " + NetUtils.getLocalHost() + " use dubbo version " + Version.getVersion() + ", please config <dubbo:registry address=\"...\" /> to your spring config.");
}
}

0 comments on commit 00b6311

Please sign in to comment.