You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by ca...@apache.org on 2018/11/19 10:52:00 UTC

[incubator-dubbo] branch master updated: [REFACTOR]:[fix typo] (#2804)

This is an automated email from the ASF dual-hosted git repository.

carryxyh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new 026fa0b  [REFACTOR]:[fix typo] (#2804)
026fa0b is described below

commit 026fa0b9f257d5186dadabf0a821a063f784ebd9
Author: Yangki Zhang <ya...@gmail.com>
AuthorDate: Mon Nov 19 18:51:51 2018 +0800

    [REFACTOR]:[fix typo] (#2804)
    
    fix typos
---
 dubbo-common/src/main/java/org/apache/dubbo/common/Version.java   | 8 ++++----
 .../test/java/org/apache/dubbo/common/version/VersionTest.java    | 8 ++++----
 .../main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java | 2 +-
 3 files changed, 9 insertions(+), 9 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 983cbb9..5c0ab76 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
@@ -41,9 +41,9 @@ public final class Version {
 
     /**
      * For protocol compatibility purpose.
-     * Because {@link #isSupportResponseAttatchment} is checked for every call, int compare expect to has higher performance than string.
+     * Because {@link #isSupportResponseAttachment} is checked for every call, int compare expect to has higher performance than string.
      */
-    private static final int LOWEST_VERSION_FOR_RESPONSE_ATTATCHMENT = 20002; // 2.0.2
+    private static final int LOWEST_VERSION_FOR_RESPONSE_ATTACHMENT = 20002; // 2.0.2
     private static final Map<String, Integer> VERSION2INT = new HashMap<String, Integer>();
 
     static {
@@ -62,7 +62,7 @@ public final class Version {
         return VERSION;
     }
 
-    public static boolean isSupportResponseAttatchment(String version) {
+    public static boolean isSupportResponseAttachment(String version) {
         if (version == null || version.length() == 0) {
             return false;
         }
@@ -72,7 +72,7 @@ public final class Version {
             return false;
         }
 
-        return iVersion >= LOWEST_VERSION_FOR_RESPONSE_ATTATCHMENT;
+        return iVersion >= LOWEST_VERSION_FOR_RESPONSE_ATTACHMENT;
     }
 
     public static int getIntVersion(String 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 d03e698..a129f53 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
@@ -30,9 +30,9 @@ public class VersionTest {
     }
 
     @Test
-    public void testSupportResponseAttatchment() {
-        Assert.assertTrue(Version.isSupportResponseAttatchment("2.0.2"));
-        Assert.assertTrue(Version.isSupportResponseAttatchment("2.0.3"));
-        Assert.assertFalse(Version.isSupportResponseAttatchment("2.0.0"));
+    public void testSupportResponseAttachment() {
+        Assert.assertTrue(Version.isSupportResponseAttachment("2.0.2"));
+        Assert.assertTrue(Version.isSupportResponseAttachment("2.0.3"));
+        Assert.assertFalse(Version.isSupportResponseAttachment("2.0.0"));
     }
 }
diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
index 60b36ee..d6a8e14 100644
--- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
+++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DubboCodec.java
@@ -191,7 +191,7 @@ public class DubboCodec extends ExchangeCodec implements Codec2 {
     protected void encodeResponseData(Channel channel, ObjectOutput out, Object data, String version) throws IOException {
         Result result = (Result) data;
         // currently, the version value in Response records the version of Request
-        boolean attach = Version.isSupportResponseAttatchment(version);
+        boolean attach = Version.isSupportResponseAttachment(version);
         Throwable th = result.getException();
         if (th == null) {
             Object ret = result.getValue();