Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] fix typos #2804

Merged
merged 1 commit into from
Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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