Skip to content

Commit

Permalink
[REFACTOR]:[fix typo] (#2804)
Browse files Browse the repository at this point in the history
fix typos
  • Loading branch information
Ivan97 authored and carryxyh committed Nov 19, 2018
1 parent 9466425 commit 026fa0b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -62,7 +62,7 @@ public static String getVersion() {
return VERSION;
}

public static boolean isSupportResponseAttatchment(String version) {
public static boolean isSupportResponseAttachment(String version) {
if (version == null || version.length() == 0) {
return false;
}
Expand All @@ -72,7 +72,7 @@ public static boolean isSupportResponseAttatchment(String version) {
return false;
}

return iVersion >= LOWEST_VERSION_FOR_RESPONSE_ATTATCHMENT;
return iVersion >= LOWEST_VERSION_FOR_RESPONSE_ATTACHMENT;
}

public static int getIntVersion(String version) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public void testGetProtocolVersion() {
}

@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"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ protected void encodeRequestData(Channel channel, ObjectOutput out, Object data,
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();
Expand Down

0 comments on commit 026fa0b

Please sign in to comment.