Skip to content

Commit ea07bbb

Browse files
refactor: 修正拼写错误并优化代码 (#4605)
1 parent 5afafc7 commit ea07bbb

File tree

13 files changed

+25
-24
lines changed

13 files changed

+25
-24
lines changed

.typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,5 @@ allow = [
3232
"Verticle",
3333
"verticle",
3434
"VERTICLE",
35+
"Prelease",
3536
]

clients/http-client-common/src/main/java/org/apache/servicecomb/http/client/common/URLEndPoint.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class URLEndPoint {
3636

3737
private final boolean sslEnabled;
3838

39-
private final Map<String, List<String>> querys;
39+
private final Map<String, List<String>> queries;
4040

4141
private final String hostOrIp;
4242

@@ -49,7 +49,7 @@ public URLEndPoint(String endpoint) {
4949
throw new IllegalArgumentException("port not specified.");
5050
}
5151
port = uri.getPort();
52-
querys = splitQuery(uri);
52+
queries = splitQuery(uri);
5353
if (endpoint.contains(HTTPS_KEY)) {
5454
sslEnabled = true;
5555
} else {
@@ -68,7 +68,7 @@ public static Map<String, List<String>> splitQuery(URI uri) {
6868
}
6969

7070
public String getFirst(String key) {
71-
List<String> values = querys.get(key);
71+
List<String> values = queries.get(key);
7272
if (values == null) {
7373
return null;
7474
}

common/common-access-log/src/main/java/org/apache/servicecomb/common/accessLog/core/element/impl/ConfigurableDatetimeAccessItem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ public ConfigurableDatetimeAccessItem(String config) {
7171
"wrong format of configuration, \"PATTERN|TIMEZONE|LOCALE\" is expected, but actually is \"" + config + "\"");
7272
}
7373

74-
setConfigruations(configArr);
74+
setConfigurations(configArr);
7575
}
7676

7777
private String[] splitConfig(String config) {
7878
return config.split("\\|{1}?", -1);
7979
}
8080

81-
private void setConfigruations(String[] configArr) {
81+
private void setConfigurations(String[] configArr) {
8282
this.pattern = StringUtils.isEmpty(configArr[0]) ? DEFAULT_DATETIME_PATTERN : configArr[0];
8383
this.timezone = StringUtils.isEmpty(configArr[1]) ? TimeZone.getDefault() : TimeZone.getTimeZone(configArr[1]);
8484
this.locale = StringUtils.isEmpty(configArr[2]) ? DEFAULT_LOCALE : Locale.forLanguageTag(configArr[2]);

common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/definition/RequestRootSerializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ public class RequestRootSerializer {
3030

3131
private final boolean isWrap;
3232

33-
public RequestRootSerializer(RootSerializer serializer, boolean isWrapp, boolean noTypesInfo) {
33+
public RequestRootSerializer(RootSerializer serializer, boolean isWrap, boolean noTypesInfo) {
3434
this.rootSerializer = serializer;
3535
this.noTypesInfo = noTypesInfo;
36-
this.isWrap = isWrapp;
36+
this.isWrap = isWrap;
3737
}
3838

3939
@SuppressWarnings("unchecked")

common/common-protobuf/src/main/java/org/apache/servicecomb/codec/protobuf/definition/ResponseRootSerializer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public class ResponseRootSerializer {
2929

3030
private final boolean isWrap;
3131

32-
public ResponseRootSerializer(RootSerializer serializer, boolean isWrapp, boolean noTypesInfo) {
32+
public ResponseRootSerializer(RootSerializer serializer, boolean isWrap, boolean noTypesInfo) {
3333
this.rootSerializer = serializer;
3434
this.noTypesInfo = noTypesInfo;
35-
this.isWrap = isWrapp;
35+
this.isWrap = isWrap;
3636
}
3737

3838
public byte[] serialize(Object value) throws IOException {

common/common-rest/src/main/java/org/apache/servicecomb/common/rest/RestConst.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ private RestConst() {
4444
public static final String BODY_PARAMETER = "servicecomb-body";
4545

4646
//in invocation response
47-
public static final String INVOCATION_HANDLER_RESPONSE = "servicecomb-invocation-hanlder-response";
47+
public static final String INVOCATION_HANDLER_RESPONSE = "servicecomb-invocation-handler-response";
4848

4949
//in invocation response
50-
public static final String INVOCATION_HANDLER_PROCESSOR = "servicecomb-invocation-hanlder-processor";
50+
public static final String INVOCATION_HANDLER_PROCESSOR = "servicecomb-invocation-handler-processor";
5151

5252
//in invocation response
53-
public static final String INVOCATION_HANDLER_REQUESTCLIENT = "servicecomb-invocation-hanlder-requestclient";
53+
public static final String INVOCATION_HANDLER_REQUESTCLIENT = "servicecomb-invocation-handler-requestclient";
5454

5555
public static final String REST_PRODUCER_INVOCATION = "servicecomb-rest-producer-invocation";
5656

common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/TestRestObjectMapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
public class TestRestObjectMapper {
4040

4141
@Test
42-
public void testFormateDate() throws Exception {
42+
public void testFormatDate() throws Exception {
4343
RestObjectMapper mapper = new RestObjectMapper();
4444
// must read/write ISO 8061 dates
4545
Date date = mapper.readValue("\"2017-07-21T17:32:28Z\"".getBytes(), Date.class);

common/common-rest/src/test/java/org/apache/servicecomb/common/rest/codec/fix/TestDoSFix.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void fastFail(Callable<?> callable, Class<?> eCls) {
7979
long start = System.currentTimeMillis();
8080
try {
8181
Object ret = callable.call();
82-
Assertions.fail("expect failed, but succes to be " + ret);
82+
Assertions.fail("expect failed, but success to be " + ret);
8383
} catch (AssertionError e) {
8484
throw e;
8585
} catch (Throwable e) {

foundations/foundation-common/src/main/java/org/apache/servicecomb/foundation/common/net/URIEndpointObject.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class URIEndpointObject extends IpPort {
4545

4646
private boolean websocketEnabled;
4747

48-
private final Map<String, List<String>> querys;
48+
private final Map<String, List<String>> queries;
4949

5050
private final String schema;
5151

@@ -58,7 +58,7 @@ public URIEndpointObject(String endpoint) {
5858
throw new IllegalArgumentException("port not specified.");
5959
}
6060
setPort(uri.getPort());
61-
querys = splitQuery(uri);
61+
queries = splitQuery(uri);
6262
sslEnabled = Boolean.parseBoolean(getFirst(SSL_ENABLED_KEY));
6363
websocketEnabled = Boolean.parseBoolean(getFirst(WEBSOCKET_ENABLED_KEY));
6464
String httpVersion = getFirst(PROTOCOL_KEY);
@@ -94,11 +94,11 @@ public String getSchema() {
9494
}
9595

9696
public List<String> getQuery(String key) {
97-
return querys.get(key);
97+
return queries.get(key);
9898
}
9999

100100
public String getFirst(String key) {
101-
List<String> values = querys.get(key);
101+
List<String> values = queries.get(key);
102102
// it's impossible that values is not null and size is 0
103103
if (values == null) {
104104
return null;

foundations/foundation-common/src/test/java/org/apache/servicecomb/foundation/common/net/TestURIEndpointObject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ public void testQueryChineseAndSpaceAndEmpty() throws UnsupportedEncodingExcepti
6565
"cse://1.1.1.1:1234/abc?a=1&b=&country=" + URLEncoder.encode("中 国", StandardCharsets.UTF_8.name());
6666
URIEndpointObject ep = new URIEndpointObject(strUri);
6767

68-
Map<String, List<String>> querys = Deencapsulation.getField(ep, "querys");
69-
Assertions.assertEquals(3, querys.size());
68+
Map<String, List<String>> queries = Deencapsulation.getField(ep, "queries");
69+
Assertions.assertEquals(3, queries.size());
7070

7171
Assertions.assertEquals(1, ep.getQuery("a").size());
7272
Assertions.assertEquals("1", ep.getFirst("a"));

0 commit comments

Comments
 (0)