diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/URL.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/URL.java index 3a6796a786af..76b09f43db9b 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/URL.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/URL.java @@ -79,71 +79,88 @@ public static String decode(String value) { return org.apache.dubbo.common.URL.decode(value); } + @Override public String getProtocol() { return super.getProtocol(); } + @Override public URL setProtocol(String protocol) { return new URL(protocol, super.getUsername(), super.getPassword(), super.getHost(), super.getPort(), super.getPath(), super.getParameters()); } + @Override public String getUsername() { return super.getUsername(); } + @Override public URL setUsername(String username) { return new URL(super.getProtocol(), username, super.getPassword(), super.getHost(), super.getPort(), super.getPath(), super.getParameters()); } + @Override public String getPassword() { return super.getPassword(); } + @Override public URL setPassword(String password) { return new URL(super.getProtocol(), super.getUsername(), password, super.getHost(), super.getPort(), super.getPath(), super.getParameters()); } + @Override public String getAuthority() { return super.getAuthority(); } + @Override public String getHost() { return super.getHost(); } + @Override public URL setHost(String host) { return new URL(super.getProtocol(), super.getUsername(), super.getPassword(), host, super.getPort(), super.getPath(), super.getParameters()); } + @Override public String getIp() { return super.getIp(); } + @Override public int getPort() { return super.getPort(); } + @Override public URL setPort(int port) { return new URL(super.getProtocol(), super.getUsername(), super.getPassword(), super.getHost(), port, super.getPath(), super.getParameters()); } + @Override public int getPort(int defaultPort) { return super.getPort(); } + @Override public String getAddress() { return super.getAddress(); } + @Override public URL setAddress(String address) { org.apache.dubbo.common.URL result = super.setAddress(address); return new URL(result); } + @Override public String getBackupAddress() { return super.getBackupAddress(); } + @Override public String getBackupAddress(int defaultPort) { return super.getBackupAddress(defaultPort); } @@ -153,191 +170,238 @@ public String getBackupAddress(int defaultPort) { // return res.stream().map(url -> new URL(url)).collect(Collectors.toList()); // } + @Override public String getPath() { return super.getPath(); } + @Override public URL setPath(String path) { return new URL(super.getProtocol(), super.getUsername(), super.getPassword(), super.getHost(), super.getPort(), path, super.getParameters()); } + @Override public String getAbsolutePath() { return super.getAbsolutePath(); } + @Override public Map getParameters() { return super.getParameters(); } + @Override public String getParameterAndDecoded(String key) { return super.getParameterAndDecoded(key); } + @Override public String getParameterAndDecoded(String key, String defaultValue) { - return super.decode(getParameter(key, defaultValue)); + return org.apache.dubbo.common.URL.decode(getParameter(key, defaultValue)); } + @Override public String getParameter(String key) { return super.getParameter(key); } + @Override public String getParameter(String key, String defaultValue) { return super.getParameter(key, defaultValue); } + @Override public String[] getParameter(String key, String[] defaultValue) { return super.getParameter(key, defaultValue); } + @Override public URL getUrlParameter(String key) { org.apache.dubbo.common.URL result = super.getUrlParameter(key); return new URL(result); } + @Override public double getParameter(String key, double defaultValue) { return super.getParameter(key, defaultValue); } + @Override public float getParameter(String key, float defaultValue) { return super.getParameter(key, defaultValue); } + @Override public long getParameter(String key, long defaultValue) { return super.getParameter(key, defaultValue); } + @Override public int getParameter(String key, int defaultValue) { return super.getParameter(key, defaultValue); } + @Override public short getParameter(String key, short defaultValue) { return super.getParameter(key, defaultValue); } + @Override public byte getParameter(String key, byte defaultValue) { return super.getParameter(key, defaultValue); } + @Override public float getPositiveParameter(String key, float defaultValue) { return super.getPositiveParameter(key, defaultValue); } + @Override public double getPositiveParameter(String key, double defaultValue) { return super.getPositiveParameter(key, defaultValue); } + @Override public long getPositiveParameter(String key, long defaultValue) { return super.getPositiveParameter(key, defaultValue); } + @Override public int getPositiveParameter(String key, int defaultValue) { return super.getPositiveParameter(key, defaultValue); } + @Override public short getPositiveParameter(String key, short defaultValue) { return super.getPositiveParameter(key, defaultValue); } + @Override public byte getPositiveParameter(String key, byte defaultValue) { return super.getPositiveParameter(key, defaultValue); } + @Override public char getParameter(String key, char defaultValue) { return super.getParameter(key, defaultValue); } + @Override public boolean getParameter(String key, boolean defaultValue) { return super.getParameter(key, defaultValue); } + @Override public boolean hasParameter(String key) { return super.hasParameter(key); } + @Override public String getMethodParameterAndDecoded(String method, String key) { return super.getMethodParameterAndDecoded(method, key); } + @Override public String getMethodParameterAndDecoded(String method, String key, String defaultValue) { return super.getMethodParameterAndDecoded(method, key, defaultValue); } + @Override public String getMethodParameter(String method, String key) { return super.getMethodParameter(method, key); } + @Override public String getMethodParameter(String method, String key, String defaultValue) { return super.getMethodParameter(method, key, defaultValue); } + @Override public double getMethodParameter(String method, String key, double defaultValue) { return super.getMethodParameter(method, key, defaultValue); } + @Override public float getMethodParameter(String method, String key, float defaultValue) { return super.getMethodParameter(method, key, defaultValue); } + @Override public long getMethodParameter(String method, String key, long defaultValue) { return super.getMethodParameter(method, key, defaultValue); } + @Override public int getMethodParameter(String method, String key, int defaultValue) { return super.getMethodParameter(method, key, defaultValue); } + @Override public short getMethodParameter(String method, String key, short defaultValue) { return super.getMethodParameter(method, key, defaultValue); } + @Override public byte getMethodParameter(String method, String key, byte defaultValue) { return super.getMethodParameter(method, key, defaultValue); } + @Override public double getMethodPositiveParameter(String method, String key, double defaultValue) { return super.getMethodPositiveParameter(method, key, defaultValue); } + @Override public float getMethodPositiveParameter(String method, String key, float defaultValue) { return super.getMethodPositiveParameter(method, key, defaultValue); } + @Override public long getMethodPositiveParameter(String method, String key, long defaultValue) { return super.getMethodPositiveParameter(method, key, defaultValue); } + @Override public int getMethodPositiveParameter(String method, String key, int defaultValue) { return super.getMethodPositiveParameter(method, key, defaultValue); } + @Override public short getMethodPositiveParameter(String method, String key, short defaultValue) { return super.getMethodPositiveParameter(method, key, defaultValue); } + @Override public byte getMethodPositiveParameter(String method, String key, byte defaultValue) { return super.getMethodPositiveParameter(method, key, defaultValue); } + @Override public char getMethodParameter(String method, String key, char defaultValue) { return super.getMethodParameter(method, key, defaultValue); } + @Override public boolean getMethodParameter(String method, String key, boolean defaultValue) { return super.getMethodParameter(method, key, defaultValue); } + @Override public boolean hasMethodParameter(String method, String key) { return super.hasMethodParameter(method, key); } + @Override public boolean isLocalHost() { return super.isLocalHost(); } + @Override public boolean isAnyHost() { return super.isAnyHost(); } + @Override public URL addParameterAndEncoded(String key, String value) { if (value == null || value.length() == 0) { return this; @@ -345,38 +409,47 @@ public URL addParameterAndEncoded(String key, String value) { return addParameter(key, encode(value)); } + @Override public URL addParameter(String key, boolean value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, char value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, byte value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, short value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, int value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, long value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, float value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, double value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, Enum value) { if (value == null) { return this; @@ -384,6 +457,7 @@ public URL addParameter(String key, Enum value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, Number value) { if (value == null) { return this; @@ -391,6 +465,7 @@ public URL addParameter(String key, Number value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, CharSequence value) { if (value == null || value.length() == 0) { return this; @@ -398,60 +473,72 @@ public URL addParameter(String key, CharSequence value) { return addParameter(key, String.valueOf(value)); } + @Override public URL addParameter(String key, String value) { org.apache.dubbo.common.URL result = super.addParameter(key, value); return new URL(result); } + @Override public URL addParameterIfAbsent(String key, String value) { org.apache.dubbo.common.URL result = super.addParameterIfAbsent(key, value); return new URL(result); } + @Override public URL addParameters(Map parameters) { org.apache.dubbo.common.URL result = super.addParameters(parameters); return new URL(result); } + @Override public URL addParametersIfAbsent(Map parameters) { org.apache.dubbo.common.URL result = super.addParametersIfAbsent(parameters); return new URL(result); } + @Override public URL addParameters(String... pairs) { org.apache.dubbo.common.URL result = super.addParameters(pairs); return new URL(result); } + @Override public URL addParameterString(String query) { org.apache.dubbo.common.URL result = super.addParameterString(query); return new URL(result); } + @Override public URL removeParameter(String key) { org.apache.dubbo.common.URL result = super.removeParameter(key); return new URL(result); } + @Override public URL removeParameters(Collection keys) { org.apache.dubbo.common.URL result = super.removeParameters(keys); return new URL(result); } + @Override public URL removeParameters(String... keys) { org.apache.dubbo.common.URL result = super.removeParameters(keys); return new URL(result); } + @Override public URL clearParameters() { org.apache.dubbo.common.URL result = super.clearParameters(); return new URL(result); } + @Override public String getRawParameter(String key) { return super.getRawParameter(key); } + @Override public Map toMap() { return super.toMap(); } @@ -461,58 +548,72 @@ public String toString() { return super.toString(); } + @Override public String toString(String... parameters) { return super.toString(parameters); } + @Override public String toIdentityString() { return super.toIdentityString(); } + @Override public String toIdentityString(String... parameters) { return super.toIdentityString(parameters); } + @Override public String toFullString() { return super.toFullString(); } + @Override public String toFullString(String... parameters) { return super.toFullString(parameters); } + @Override public String toParameterString() { return super.toParameterString(); } + @Override public String toParameterString(String... parameters) { return super.toParameterString(parameters); } + @Override public java.net.URL toJavaURL() { return super.toJavaURL(); } + @Override public InetSocketAddress toInetSocketAddress() { return super.toInetSocketAddress(); } + @Override public String getServiceKey() { return super.getServiceKey(); } + @Override public String toServiceStringWithoutResolving() { return super.toServiceStringWithoutResolving(); } + @Override public String toServiceString() { return super.toServiceString(); } + @Override public String getServiceInterface() { return super.getServiceInterface(); } + @Override public URL setServiceInterface(String service) { org.apache.dubbo.common.URL result = super.setServiceInterface(service); return new URL(result); diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/status/StatusChecker.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/status/StatusChecker.java index a1405475459b..3f74c133ffac 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/status/StatusChecker.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/common/status/StatusChecker.java @@ -20,5 +20,6 @@ @Deprecated public interface StatusChecker extends org.apache.dubbo.common.status.StatusChecker { + @Override Status check(); } diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/Monitor.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/Monitor.java index 7444d865738b..3d4abb3cd652 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/Monitor.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/monitor/Monitor.java @@ -25,6 +25,7 @@ @Deprecated public interface Monitor extends org.apache.dubbo.monitor.Monitor { + @Override com.alibaba.dubbo.common.URL getUrl(); void collect(com.alibaba.dubbo.common.URL statistics); diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/Registry.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/Registry.java index c5a84231a44d..cc9ceb14ee16 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/Registry.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/registry/Registry.java @@ -26,6 +26,7 @@ @Deprecated public interface Registry extends org.apache.dubbo.registry.Registry { + @Override com.alibaba.dubbo.common.URL getUrl(); void register(com.alibaba.dubbo.common.URL url); diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/Channel.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/Channel.java index c1606e7facc9..a900047fb98a 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/Channel.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/remoting/Channel.java @@ -20,7 +20,9 @@ @Deprecated public interface Channel extends org.apache.dubbo.remoting.Channel { + @Override com.alibaba.dubbo.common.URL getUrl(); + @Override com.alibaba.dubbo.remoting.ChannelHandler getChannelHandler(); } diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Exporter.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Exporter.java index 84ef9fe06fc5..c1fadeb9d833 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Exporter.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Exporter.java @@ -20,6 +20,7 @@ @Deprecated public interface Exporter extends org.apache.dubbo.rpc.Exporter { + @Override Invoker getInvoker(); class CompatibleExporter implements Exporter { diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Filter.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Filter.java index 8da72027632a..4ccde294e3a2 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Filter.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Filter.java @@ -22,6 +22,7 @@ public interface Filter extends org.apache.dubbo.rpc.Filter { Result invoke(Invoker invoker, Invocation invocation) throws RpcException; + @Override default org.apache.dubbo.rpc.Result invoke(org.apache.dubbo.rpc.Invoker invoker, org.apache.dubbo.rpc.Invocation invocation) throws org.apache.dubbo.rpc.RpcException { diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invocation.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invocation.java index 2306e3ecb504..b96d14d1ee4a 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invocation.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invocation.java @@ -22,6 +22,7 @@ @Deprecated public interface Invocation extends org.apache.dubbo.rpc.Invocation { + @Override Invoker getInvoker(); default org.apache.dubbo.rpc.Invocation getOriginal() { @@ -71,6 +72,7 @@ public Invoker getInvoker() { return new Invoker.CompatibleInvoker(delegate.getInvoker()); } + @Override public org.apache.dubbo.rpc.Invocation getOriginal() { return delegate; } diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invoker.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invoker.java index 3e796765406f..55a948083f03 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invoker.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/Invoker.java @@ -22,6 +22,7 @@ @Deprecated public interface Invoker extends org.apache.dubbo.rpc.Invoker { + @Override Result invoke(org.apache.dubbo.rpc.Invocation invocation) throws RpcException; default org.apache.dubbo.rpc.Invoker getOriginal() { @@ -61,6 +62,7 @@ public void destroy() { invoker.destroy(); } + @Override public org.apache.dubbo.rpc.Invoker getOriginal() { return invoker; } diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Directory.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Directory.java index d883f84abccd..6e87c613513e 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Directory.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Directory.java @@ -17,18 +17,19 @@ package com.alibaba.dubbo.rpc.cluster; -import com.alibaba.dubbo.common.URL; - import org.apache.dubbo.rpc.Invocation; import org.apache.dubbo.rpc.Invoker; import org.apache.dubbo.rpc.RpcException; +import com.alibaba.dubbo.common.URL; + import java.util.List; import java.util.stream.Collectors; @Deprecated public interface Directory extends org.apache.dubbo.rpc.cluster.Directory { + @Override URL getUrl(); List> list(com.alibaba.dubbo.rpc.Invocation invocation) throws com.alibaba.dubbo.rpc.RpcException; diff --git a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Router.java b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Router.java index f3d5ddca5954..8a2750386811 100644 --- a/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Router.java +++ b/dubbo-compatible/src/main/java/com/alibaba/dubbo/rpc/cluster/Router.java @@ -28,6 +28,7 @@ @Deprecated public interface Router extends org.apache.dubbo.rpc.cluster.Router { + @Override com.alibaba.dubbo.common.URL getUrl(); List> route(List> invokers, diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java index ed0fb5c42050..e82239588c57 100644 --- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java +++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/annotation/ReferenceAnnotationBeanPostProcessor.java @@ -16,12 +16,13 @@ */ package org.apache.dubbo.config.spring.beans.factory.annotation; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.dubbo.common.Constants; import org.apache.dubbo.common.utils.StringUtils; import org.apache.dubbo.config.annotation.Reference; import org.apache.dubbo.config.spring.ReferenceBean; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.beans.BeanUtils; import org.springframework.beans.BeansException; import org.springframework.beans.PropertyValues; @@ -581,7 +582,9 @@ private static boolean nullSafeEquals(Object first, Object another) { } private String toPlainString(String[] array) { - if (array == null || array.length == 0) return ""; + if (array == null || array.length == 0) { + return ""; + } StringBuilder buffer = new StringBuilder(); for (int i = 0; i < array.length; i++) { if (i > 0) { diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/service/GenericService.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/service/GenericService.java index e6b3168d6280..b63b60bd3e1e 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/service/GenericService.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/service/GenericService.java @@ -20,6 +20,7 @@ @Deprecated public interface GenericService extends org.apache.dubbo.rpc.service.GenericService { + @Override Object $invoke(String method, String[] parameterTypes, Object[] args) throws com.alibaba.dubbo.rpc.service.GenericException; } diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AbstractResult.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AbstractResult.java index 064fd9fd90c6..760a9c1a1116 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AbstractResult.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AbstractResult.java @@ -64,6 +64,7 @@ public String getAttachment(String key, String defaultValue) { return result; } + @Override public void setAttachment(String key, String value) { attachments.put(key, value); } diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContextImpl.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContextImpl.java index 9e4ddaf9ee6f..0142f7391534 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContextImpl.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContextImpl.java @@ -71,6 +71,7 @@ public void start() { this.started.set(true); } + @Override public void signalContextSwitch() { RpcContext.restoreContext(storedContext); RpcContext.restoreServerContext(storedServerContext); diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java index e9ed9156c03a..81a8c75737d1 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncRpcResult.java @@ -162,6 +162,7 @@ public String getAttachment(String key, String defaultValue) { return getRpcResult().getAttachment(key, defaultValue); } + @Override public void setAttachment(String key, String value) { getRpcResult().setAttachment(key, value); }