This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch 2.7.0-release in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
commit f73e8cc3f589f47d858b2b21f43fd2c98701f027 Author: ken.lj <[email protected]> AuthorDate: Tue Jan 15 14:54:20 2019 +0800 refactor method name --- .../main/java/org/apache/dubbo/common/Version.java | 4 ++-- .../apache/dubbo/common/version/VersionTest.java | 24 +++++++++++----------- .../dubbo/rpc/protocol/http/HttpProtocol.java | 4 ++-- .../apache/dubbo/rpc/protocol/rmi/RmiProtocol.java | 8 ++++---- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/Version.java b/dubbo-common/src/main/java/org/apache/dubbo/common/Version.java index 4c5ef9c..6deb406 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/common/Version.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/common/Version.java @@ -67,7 +67,7 @@ public final class Version { /** * To check the framework release version number to decide if it's 2.7.0 or higher */ - public static boolean isFramework270OrHigher (String version) { + public static boolean isRelease270OrHigher(String version) { if (StringUtils.isEmpty(version)) { return false; } @@ -84,7 +84,7 @@ public final class Version { * and moreover we have no other approach to check the framework version number, so we use * isSupportResponseAttachment to decide if it's v2.6.3 */ - public static boolean isFramework263OrHigher (String version) { + public static boolean isRelease263OrHigher(String version) { return isSupportResponseAttachment(version); } diff --git a/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java b/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java index 032c22d..fd00216 100644 --- a/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java +++ b/dubbo-common/src/test/java/org/apache/dubbo/common/version/VersionTest.java @@ -46,21 +46,21 @@ public class VersionTest { @Test public void testIsFramework270OrHigher() { - Assert.assertTrue(Version.isFramework270OrHigher("2.7.0")); - Assert.assertTrue(Version.isFramework270OrHigher("2.7.0.1")); - Assert.assertTrue(Version.isFramework270OrHigher("2.7.0.2")); - Assert.assertTrue(Version.isFramework270OrHigher("2.8.0")); - Assert.assertFalse(Version.isFramework270OrHigher("2.6.3")); - Assert.assertFalse(Version.isFramework270OrHigher("2.6.3.1")); + Assert.assertTrue(Version.isRelease270OrHigher("2.7.0")); + Assert.assertTrue(Version.isRelease270OrHigher("2.7.0.1")); + Assert.assertTrue(Version.isRelease270OrHigher("2.7.0.2")); + Assert.assertTrue(Version.isRelease270OrHigher("2.8.0")); + Assert.assertFalse(Version.isRelease270OrHigher("2.6.3")); + Assert.assertFalse(Version.isRelease270OrHigher("2.6.3.1")); } @Test public void testIsFramework263OrHigher() { - Assert.assertTrue(Version.isFramework263OrHigher("2.7.0")); - Assert.assertTrue(Version.isFramework263OrHigher("2.7.0.1")); - Assert.assertTrue(Version.isFramework263OrHigher("2.6.4")); - Assert.assertFalse(Version.isFramework263OrHigher("2.6.2")); - Assert.assertFalse(Version.isFramework263OrHigher("2.6.1.1")); - Assert.assertTrue(Version.isFramework263OrHigher("2.6.3")); + Assert.assertTrue(Version.isRelease263OrHigher("2.7.0")); + Assert.assertTrue(Version.isRelease263OrHigher("2.7.0.1")); + Assert.assertTrue(Version.isRelease263OrHigher("2.6.4")); + Assert.assertFalse(Version.isRelease263OrHigher("2.6.2")); + Assert.assertFalse(Version.isRelease263OrHigher("2.6.1.1")); + Assert.assertTrue(Version.isRelease263OrHigher("2.6.3")); } } diff --git a/dubbo-rpc/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java b/dubbo-rpc/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java index 8246f34..0ffa165 100644 --- a/dubbo-rpc/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java +++ b/dubbo-rpc/dubbo-rpc-http/src/main/java/org/apache/dubbo/rpc/protocol/http/HttpProtocol.java @@ -122,7 +122,7 @@ public class HttpProtocol extends AbstractProxyProtocol { package was renamed to 'org.apache.dubbo' in v2.7.0, so only provider versions after v2.7.0 can recognize org.apache.xxx.HttpRemoteInvocation'. */ - if (Version.isFramework270OrHigher(url.getParameter(Constants.RELEASE_KEY))) { + if (Version.isRelease270OrHigher(url.getParameter(Constants.RELEASE_KEY))) { invocation = new HttpRemoteInvocation(methodInvocation); } else { /* @@ -132,7 +132,7 @@ public class HttpProtocol extends AbstractProxyProtocol { versions, we need to check if the provider is v2.6.3 or higher before sending customized HttpRemoteInvocation. */ - if (Version.isFramework263OrHigher(url.getParameter(Constants.DUBBO_VERSION_KEY))) { + if (Version.isRelease263OrHigher(url.getParameter(Constants.DUBBO_VERSION_KEY))) { invocation = new com.alibaba.dubbo.rpc.protocol.http.HttpRemoteInvocation(methodInvocation); } else { invocation = new RemoteInvocation(methodInvocation); diff --git a/dubbo-rpc/dubbo-rpc-rmi/src/main/java/org/apache/dubbo/rpc/protocol/rmi/RmiProtocol.java b/dubbo-rpc/dubbo-rpc-rmi/src/main/java/org/apache/dubbo/rpc/protocol/rmi/RmiProtocol.java index 5f8b02af..6a6a4a6 100644 --- a/dubbo-rpc/dubbo-rpc-rmi/src/main/java/org/apache/dubbo/rpc/protocol/rmi/RmiProtocol.java +++ b/dubbo-rpc/dubbo-rpc-rmi/src/main/java/org/apache/dubbo/rpc/protocol/rmi/RmiProtocol.java @@ -29,8 +29,8 @@ import java.io.IOException; import java.net.SocketTimeoutException; import java.rmi.RemoteException; -import static org.apache.dubbo.common.Version.isFramework263OrHigher; -import static org.apache.dubbo.common.Version.isFramework270OrHigher; +import static org.apache.dubbo.common.Version.isRelease263OrHigher; +import static org.apache.dubbo.common.Version.isRelease270OrHigher; /** * RmiProtocol. @@ -85,9 +85,9 @@ public class RmiProtocol extends AbstractProxyProtocol { 2. if the provider version is v2.6.3 or higher, send 'com.alibaba.dubbo.rpc.protocol.rmi.RmiRemoteInvocation'. 3. if the provider version is lower than v2.6.3, does not use customized RemoteInvocation. */ - if (isFramework270OrHigher(url.getParameter(Constants.RELEASE_KEY))) { + if (isRelease270OrHigher(url.getParameter(Constants.RELEASE_KEY))) { rmiProxyFactoryBean.setRemoteInvocationFactory(RmiRemoteInvocation::new); - } else if (isFramework263OrHigher(url.getParameter(Constants.DUBBO_VERSION_KEY))) { + } else if (isRelease263OrHigher(url.getParameter(Constants.DUBBO_VERSION_KEY))) { rmiProxyFactoryBean.setRemoteInvocationFactory(com.alibaba.dubbo.rpc.protocol.rmi.RmiRemoteInvocation::new); } rmiProxyFactoryBean.setServiceUrl(url.toIdentityString());
