Skip to content

Commit 8dabe60

Browse files
authored
fix typos (#15625)
* fix typos * fix
1 parent 9718408 commit 8dabe60

8 files changed

Lines changed: 25 additions & 23 deletions

File tree

dubbo-common/src/main/java/org/apache/dubbo/common/constants/RegistryConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,5 +148,5 @@ public interface RegistryConstants {
148148
* by default, dubbo export servicename is "${interface}:${version}:", this servicename with ':' suffix
149149
* for compatible, we should export noting suffix servicename, eg: ${interface}:${version}
150150
*/
151-
String NACOE_REGISTER_COMPATIBLE = "nacos.register-compatible";
151+
String NACOS_REGISTER_COMPATIBLE = "nacos.register-compatible";
152152
}

dubbo-common/src/main/java/org/apache/dubbo/common/timer/HashedWheelTimer.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public class HashedWheelTimer implements Timer {
8888
/**
8989
* may be in spi?
9090
*/
91-
public static final String NAME = "hased";
91+
public static final String NAME = "hashed";
9292

9393
private static final ErrorTypeAwareLogger logger = LoggerFactory.getErrorTypeAwareLogger(HashedWheelTimer.class);
9494

@@ -306,11 +306,11 @@ private static int normalizeTicksPerWheel(int ticksPerWheel) {
306306
}
307307

308308
/**
309-
* Starts the background thread explicitly. The background thread will
309+
* Starts the background thread explicitly. The background thread will
310310
* start automatically on demand even if you did not call this method.
311311
*
312312
* @throws IllegalStateException if this timer has been
313-
* {@linkplain #stop() stopped} already
313+
* {@linkplain #stop() stopped} already
314314
*/
315315
public void start() {
316316
switch (WORKER_STATE_UPDATER.get(this)) {
@@ -698,7 +698,7 @@ public String toString() {
698698
private static final class HashedWheelBucket {
699699

700700
/**
701-
* Used for the linked-list datastructure
701+
* Used for the linked-list data structure
702702
*/
703703
private HashedWheelTimeout head;
704704
private HashedWheelTimeout tail;

dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
import static org.apache.dubbo.common.constants.RegistryConstants.DEFAULT_ENABLE_EMPTY_PROTECTION;
7676
import static org.apache.dubbo.common.constants.RegistryConstants.EMPTY_PROTOCOL;
7777
import static org.apache.dubbo.common.constants.RegistryConstants.ENABLE_EMPTY_PROTECTION_KEY;
78-
import static org.apache.dubbo.common.constants.RegistryConstants.NACOE_REGISTER_COMPATIBLE;
78+
import static org.apache.dubbo.common.constants.RegistryConstants.NACOS_REGISTER_COMPATIBLE;
7979
import static org.apache.dubbo.common.constants.RegistryConstants.PROVIDERS_CATEGORY;
8080
import static org.apache.dubbo.common.constants.RegistryConstants.REGISTER_CONSUMER_URL_KEY;
8181
import static org.apache.dubbo.common.constants.RegistryConstants.ROUTERS_CATEGORY;
@@ -188,7 +188,7 @@ public void doRegister(URL url) {
188188
serviceNames.add(serviceName);
189189

190190
// in https://github.com/apache/dubbo/issues/14075
191-
if (getUrl().getParameter(NACOE_REGISTER_COMPATIBLE, false)) {
191+
if (getUrl().getParameter(NACOS_REGISTER_COMPATIBLE, false)) {
192192
// servicename is "org.apache.dubbo.xxService:1.0.0"
193193
String compatibleServiceName = getServiceName(url, true);
194194
serviceNames.add(compatibleServiceName);
@@ -227,7 +227,7 @@ public void doUnregister(final URL url) {
227227
serviceNames.add(serviceName);
228228

229229
// in https://github.com/apache/dubbo/issues/14075
230-
if (getUrl().getParameter(NACOE_REGISTER_COMPATIBLE, false)) {
230+
if (getUrl().getParameter(NACOS_REGISTER_COMPATIBLE, false)) {
231231
// servicename is "org.apache.dubbo.xxService:1.0.0"
232232
String serviceName1 = getServiceName(url, true);
233233
serviceNames.add(serviceName1);

dubbo-remoting/dubbo-remoting-api/src/test/java/org/apache/dubbo/remoting/codec/ExchangeCodecTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void test_Decode_Error_Length() throws IOException {
164164

165165
@Test
166166
void test_Decode_Error_Response_Object() throws IOException {
167-
// 00000010-response/oneway/hearbeat=true |20-stats=ok|id=0|length=0
167+
// 00000010-response/oneway/heartbeat=true |20-stats=ok|id=0|length=0
168168
byte[] header = new byte[] {MAGIC_HIGH, MAGIC_LOW, SERIALIZATION_BYTE, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
169169
Person person = new Person();
170170
byte[] request = getRequestBytes(person, header);
@@ -242,7 +242,7 @@ void test_Decode_MigicCodec_Contain_ExchangeHeader() throws IOException {
242242
void test_Decode_Return_Response_Person() throws IOException {
243243
DefaultFuture future = DefaultFuture.newFuture(Mockito.mock(Channel.class), new Request(0), 100000, null);
244244

245-
// 00000010-response/oneway/hearbeat=false/hessian |20-stats=ok|id=0|length=0
245+
// 00000010-response/oneway/heartbeat=false/hessian |20-stats=ok|id=0|length=0
246246
byte[] header = new byte[] {MAGIC_HIGH, MAGIC_LOW, SERIALIZATION_BYTE, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
247247
Person person = new Person();
248248
byte[] request = getRequestBytes(person, header);
@@ -334,7 +334,7 @@ void test_Decode_Return_Request_Object() throws IOException {
334334

335335
@Test
336336
void test_Decode_Error_Request_Object() throws IOException {
337-
// 00000010-response/oneway/hearbeat=true |20-stats=ok|id=0|length=0
337+
// 00000010-response/oneway/heartbeat=true |20-stats=ok|id=0|length=0
338338
byte[] header = new byte[] {
339339
MAGIC_HIGH, MAGIC_LOW, (byte) (SERIALIZATION_BYTE | (byte) 0xe0), 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
340340
};
@@ -353,7 +353,7 @@ void test_Decode_Error_Request_Object() throws IOException {
353353
void test_Header_Response_NoSerializationFlag() throws IOException {
354354
DefaultFuture future = DefaultFuture.newFuture(Mockito.mock(Channel.class), new Request(0), 100000, null);
355355

356-
// 00000010-response/oneway/hearbeat=false/noset |20-stats=ok|id=0|length=0
356+
// 00000010-response/oneway/heartbeat=false/noset |20-stats=ok|id=0|length=0
357357
byte[] header = new byte[] {MAGIC_HIGH, MAGIC_LOW, SERIALIZATION_BYTE, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
358358
Person person = new Person();
359359
byte[] request = getRequestBytes(person, header);
@@ -369,7 +369,7 @@ void test_Header_Response_NoSerializationFlag() throws IOException {
369369
void test_Header_Response_Heartbeat() throws IOException {
370370
DefaultFuture future = DefaultFuture.newFuture(Mockito.mock(Channel.class), new Request(0), 100000, null);
371371

372-
// 00000010-response/oneway/hearbeat=true |20-stats=ok|id=0|length=0
372+
// 00000010-response/oneway/heartbeat=true |20-stats=ok|id=0|length=0
373373
byte[] header = new byte[] {MAGIC_HIGH, MAGIC_LOW, SERIALIZATION_BYTE, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
374374
Person person = new Person();
375375
byte[] request = getRequestBytes(person, header);

dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/filter/GenericFilter.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,22 +256,22 @@ public Method findMethodByMethodSignature(
256256
throws NoSuchMethodException, ClassNotFoundException {
257257
Method method;
258258
if (parameterTypes == null) {
259-
List<Method> finded = new ArrayList<>();
259+
List<Method> found = new ArrayList<>();
260260
for (Method m : clazz.getMethods()) {
261261
if (m.getName().equals(methodName)) {
262-
finded.add(m);
262+
found.add(m);
263263
}
264264
}
265-
if (finded.isEmpty()) {
265+
if (found.isEmpty()) {
266266
throw new NoSuchMethodException("No such method " + methodName + " in class " + clazz);
267267
}
268-
if (finded.size() > 1) {
268+
if (found.size() > 1) {
269269
String msg = String.format(
270270
"Not unique method for method name(%s) in class(%s), find %d methods.",
271-
methodName, clazz.getName(), finded.size());
271+
methodName, clazz.getName(), found.size());
272272
throw new IllegalStateException(msg);
273273
}
274-
method = finded.get(0);
274+
method = found.get(0);
275275
} else {
276276
Class<?>[] types = new Class<?>[parameterTypes.length];
277277
for (int i = 0; i < parameterTypes.length; i++) {

dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/RequestPath.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private RequestPath(String path, String stubPath, String serviceInterface, Strin
3030
this.methodName = methodName;
3131
}
3232

33-
// Request path patten:
33+
// Request path pattern:
3434
// '{interfaceName}/{methodName}' or '{contextPath}/{interfaceName}/{methodName}'
3535
// └─── path ────┘ └─ method ─┘ └────────── path ───────────┘ └─ method ─┘
3636
public static RequestPath parse(String fullPath) {

dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TripleCustomerProtocolWrapper.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ public static TripleResponseWrapper parseFrom(byte[] data) {
106106
int fieldNum = extractFieldNumFromTag(tag);
107107
int wireType = extractWireTypeFromTag(tag);
108108
if (wireType != 2) {
109-
throw new RuntimeException(String.format("unexpect wireType, expect %d realType %d", 2, wireType));
109+
throw new RuntimeException(
110+
String.format("unexpected wireType, expect %d realType %d", 2, wireType));
110111
}
111112
if (fieldNum == 1) {
112113
int serializeTypeLength = readRawVarint32(byteBuffer);
@@ -237,7 +238,8 @@ public static TripleRequestWrapper parseFrom(byte[] data) {
237238
int fieldNum = extractFieldNumFromTag(tag);
238239
int wireType = extractWireTypeFromTag(tag);
239240
if (wireType != 2) {
240-
throw new RuntimeException(String.format("unexpect wireType, expect %d realType %d", 2, wireType));
241+
throw new RuntimeException(
242+
String.format("unexpected wireType, expect %d realType %d", 2, wireType));
241243
}
242244
if (fieldNum == 1) {
243245
int serializeTypeLength = readRawVarint32(byteBuffer);

dubbo-rpc/dubbo-rpc-triple/src/main/java/org/apache/dubbo/rpc/protocol/tri/TriplePathResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public void register(Invoker<?> invoker) {
4141

4242
register0(serviceKey, serviceInterface, invoker, url);
4343

44-
// Path patten: '{interfaceName}' or '{contextPath}/{interfaceName}'
44+
// Path pattern: '{interfaceName}' or '{contextPath}/{interfaceName}'
4545
String path = url.getPath();
4646
int index = path.lastIndexOf('/');
4747
if (index == -1) {

0 commit comments

Comments
 (0)