Skip to content

Commit efa8332

Browse files
moriadryCrazyHZM
authored andcommitted
fix typo in dubbo (#3937)
1 parent b8d9f76 commit efa8332

File tree

10 files changed

+48
-48
lines changed

10 files changed

+48
-48
lines changed

dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/loadbalance/LeastActiveLoadBalance.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation
7171
leastActive = active;
7272
// Reset the number of least active invokers
7373
leastCount = 1;
74-
// Put the first least active invoker first in leastIndexs
74+
// Put the first least active invoker first in leastIndexes
7575
leastIndexes[0] = i;
7676
// Reset totalWeight
7777
totalWeight = afterWarmup;
@@ -81,7 +81,7 @@ protected <T> Invoker<T> doSelect(List<Invoker<T>> invokers, URL url, Invocation
8181
sameWeight = true;
8282
// If current invoker's active value equals with leaseActive, then accumulating.
8383
} else if (active == leastActive) {
84-
// Record the index of the least active invoker in leastIndexs order
84+
// Record the index of the least active invoker in leastIndexes order
8585
leastIndexes[leastCount++] = i;
8686
// Accumulate the total weight of the least active invoker
8787
totalWeight += afterWarmup;

dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LeastActiveBalanceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void testLeastActiveLoadBalance_select() {
3535
Long count = entry.getValue().get();
3636
// System.out.println(count);
3737
Assertions.assertTrue(
38-
Math.abs(count - runs / (0f + invokers.size())) < runs / (0f + invokers.size()), "abs diff shoud < avg");
38+
Math.abs(count - runs / (0f + invokers.size())) < runs / (0f + invokers.size()), "abs diff should < avg");
3939
}
4040
}
4141

dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/support/FailfastClusterInvokerTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private void resetInvoker1ToNoException() {
8080
}
8181

8282
@Test
83-
public void testInvokeExceptoin() {
83+
public void testInvokeException() {
8484
Assertions.assertThrows(RpcException.class, () -> {
8585
resetInvoker1ToException();
8686
FailfastClusterInvoker<FailfastClusterInvokerTest> invoker = new FailfastClusterInvoker<FailfastClusterInvokerTest>(dic);
@@ -90,7 +90,7 @@ public void testInvokeExceptoin() {
9090
}
9191

9292
@Test()
93-
public void testInvokeNoExceptoin() {
93+
public void testInvokeNoException() {
9494

9595
resetInvoker1ToNoException();
9696

dubbo-common/src/main/java/org/apache/dubbo/common/extension/AdaptiveClassCodeGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private String generateMethodContent(Method method) {
224224
code.append(generateExtensionAssignment());
225225

226226
// return statement
227-
code.append(generateReturnAndInovation(method));
227+
code.append(generateReturnAndInvocation(method));
228228
}
229229

230230
return code.toString();
@@ -292,7 +292,7 @@ private String generateExtensionAssignment() {
292292
/**
293293
* generate method invocation statement and return it if necessary
294294
*/
295-
private String generateReturnAndInovation(Method method) {
295+
private String generateReturnAndInvocation(Method method) {
296296
String returnStatement = method.getReturnType().equals(void.class) ? "" : "return ";
297297

298298
String args = Arrays.stream(method.getParameters()).map(Parameter::getName).collect(Collectors.joining(", "));

dubbo-common/src/test/java/org/apache/dubbo/common/beanutil/JavaBeanSerializeUtilTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -441,20 +441,20 @@ static void assertEqualsBigPerson(BigPerson person, Object obj) {
441441
assertEqualsPrimitive(person.getInfoProfile().isMale(), infoProfile.getProperty("male"));
442442
}
443443

444-
static void assertEqualsPhone(Phone excpected, Object obj) {
444+
static void assertEqualsPhone(Phone expected, Object obj) {
445445
JavaBeanDescriptor descriptor = (JavaBeanDescriptor) obj;
446446
Assertions.assertTrue(descriptor.isBeanType());
447-
if (excpected.getArea() != null) {
448-
assertEqualsPrimitive(excpected.getArea(), descriptor.getProperty("area"));
447+
if (expected.getArea() != null) {
448+
assertEqualsPrimitive(expected.getArea(), descriptor.getProperty("area"));
449449
}
450-
if (excpected.getCountry() != null) {
451-
assertEqualsPrimitive(excpected.getCountry(), descriptor.getProperty("country"));
450+
if (expected.getCountry() != null) {
451+
assertEqualsPrimitive(expected.getCountry(), descriptor.getProperty("country"));
452452
}
453-
if (excpected.getExtensionNumber() != null) {
454-
assertEqualsPrimitive(excpected.getExtensionNumber(), descriptor.getProperty("extensionNumber"));
453+
if (expected.getExtensionNumber() != null) {
454+
assertEqualsPrimitive(expected.getExtensionNumber(), descriptor.getProperty("extensionNumber"));
455455
}
456-
if (excpected.getNumber() != null) {
457-
assertEqualsPrimitive(excpected.getNumber(), descriptor.getProperty("number"));
456+
if (expected.getNumber() != null) {
457+
assertEqualsPrimitive(expected.getNumber(), descriptor.getProperty("number"));
458458
}
459459
}
460460

dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/AbstractConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ public void testRefreshAll() {
306306

307307
System.setProperty("dubbo.override.address", "system://127.0.0.1:2181");
308308
System.setProperty("dubbo.override.protocol", "system");
309-
// this will not override, use 'key' instread, @Parameter(key="key1", useKeyAsProperty=false)
309+
// this will not override, use 'key' instead, @Parameter(key="key1", useKeyAsProperty=false)
310310
System.setProperty("dubbo.override.key1", "system");
311311
System.setProperty("dubbo.override.key2", "system");
312312

dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/support/AbstractRegistryTest.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -312,20 +312,20 @@ public void testRecover2() throws Exception {
312312
@Test
313313
public void testNotify() throws Exception {
314314
final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
315-
NotifyListener listner1 = urls -> notified.set(Boolean.TRUE);
315+
NotifyListener listener1 = urls -> notified.set(Boolean.TRUE);
316316
URL url1 = new URL("dubbo", "192.168.0.1", 2200, parametersConsumer);
317-
abstractRegistry.subscribe(url1, listner1);
318-
NotifyListener listner2 = urls -> notified.set(Boolean.TRUE);
317+
abstractRegistry.subscribe(url1, listener1);
318+
NotifyListener listener2 = urls -> notified.set(Boolean.TRUE);
319319
URL url2 = new URL("dubbo", "192.168.0.2", 2201, parametersConsumer);
320-
abstractRegistry.subscribe(url2, listner2);
321-
NotifyListener listner3 = urls -> notified.set(Boolean.TRUE);
320+
abstractRegistry.subscribe(url2, listener2);
321+
NotifyListener listener3 = urls -> notified.set(Boolean.TRUE);
322322
URL url3 = new URL("dubbo", "192.168.0.3", 2202, parametersConsumer);
323-
abstractRegistry.subscribe(url3, listner3);
323+
abstractRegistry.subscribe(url3, listener3);
324324
List<URL> urls = new ArrayList<>();
325325
urls.add(url1);
326326
urls.add(url2);
327327
urls.add(url3);
328-
abstractRegistry.notify(url1, listner1, urls);
328+
abstractRegistry.notify(url1, listener1, urls);
329329
Map<URL, Map<String, List<URL>>> map = abstractRegistry.getNotified();
330330
MatcherAssert.assertThat(true, Matchers.equalTo(map.containsKey(url1)));
331331
MatcherAssert.assertThat(false, Matchers.equalTo(map.containsKey(url2)));
@@ -338,15 +338,15 @@ public void testNotify() throws Exception {
338338
@Test
339339
public void testNotifyList() throws Exception {
340340
final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
341-
NotifyListener listner1 = urls -> notified.set(Boolean.TRUE);
341+
NotifyListener listener1 = urls -> notified.set(Boolean.TRUE);
342342
URL url1 = new URL("dubbo", "192.168.0.1", 2200, parametersConsumer);
343-
abstractRegistry.subscribe(url1, listner1);
344-
NotifyListener listner2 = urls -> notified.set(Boolean.TRUE);
343+
abstractRegistry.subscribe(url1, listener1);
344+
NotifyListener listener2 = urls -> notified.set(Boolean.TRUE);
345345
URL url2 = new URL("dubbo", "192.168.0.2", 2201, parametersConsumer);
346-
abstractRegistry.subscribe(url2, listner2);
347-
NotifyListener listner3 = urls -> notified.set(Boolean.TRUE);
346+
abstractRegistry.subscribe(url2, listener2);
347+
NotifyListener listener3 = urls -> notified.set(Boolean.TRUE);
348348
URL url3 = new URL("dubbo", "192.168.0.3", 2202, parametersConsumer);
349-
abstractRegistry.subscribe(url3, listner3);
349+
abstractRegistry.subscribe(url3, listener3);
350350
List<URL> urls = new ArrayList<>();
351351
urls.add(url1);
352352
urls.add(url2);
@@ -362,20 +362,20 @@ public void testNotifyList() throws Exception {
362362
public void testNotifyIfURLNull() throws Exception {
363363
Assertions.assertThrows(IllegalArgumentException.class, () -> {
364364
final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
365-
NotifyListener listner1 = urls -> notified.set(Boolean.TRUE);
365+
NotifyListener listener1 = urls -> notified.set(Boolean.TRUE);
366366
URL url1 = new URL("dubbo", "192.168.0.1", 2200, parametersConsumer);
367-
abstractRegistry.subscribe(url1, listner1);
368-
NotifyListener listner2 = urls -> notified.set(Boolean.TRUE);
367+
abstractRegistry.subscribe(url1, listener1);
368+
NotifyListener listener2 = urls -> notified.set(Boolean.TRUE);
369369
URL url2 = new URL("dubbo", "192.168.0.2", 2201, parametersConsumer);
370-
abstractRegistry.subscribe(url2, listner2);
371-
NotifyListener listner3 = urls -> notified.set(Boolean.TRUE);
370+
abstractRegistry.subscribe(url2, listener2);
371+
NotifyListener listener3 = urls -> notified.set(Boolean.TRUE);
372372
URL url3 = new URL("dubbo", "192.168.0.3", 2202, parametersConsumer);
373-
abstractRegistry.subscribe(url3, listner3);
373+
abstractRegistry.subscribe(url3, listener3);
374374
List<URL> urls = new ArrayList<>();
375375
urls.add(url1);
376376
urls.add(url2);
377377
urls.add(url3);
378-
abstractRegistry.notify(null, listner1, urls);
378+
abstractRegistry.notify(null, listener1, urls);
379379
Assertions.fail("notify url == null");
380380
});
381381
}
@@ -384,15 +384,15 @@ public void testNotifyIfURLNull() throws Exception {
384384
public void testNotifyIfNotifyNull() {
385385
Assertions.assertThrows(IllegalArgumentException.class, () -> {
386386
final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false);
387-
NotifyListener listner1 = urls -> notified.set(Boolean.TRUE);
387+
NotifyListener listener1 = urls -> notified.set(Boolean.TRUE);
388388
URL url1 = new URL("dubbo", "192.168.0.1", 2200, parametersConsumer);
389-
abstractRegistry.subscribe(url1, listner1);
390-
NotifyListener listner2 = urls -> notified.set(Boolean.TRUE);
389+
abstractRegistry.subscribe(url1, listener1);
390+
NotifyListener listener2 = urls -> notified.set(Boolean.TRUE);
391391
URL url2 = new URL("dubbo", "192.168.0.2", 2201, parametersConsumer);
392-
abstractRegistry.subscribe(url2, listner2);
393-
NotifyListener listner3 = urls -> notified.set(Boolean.TRUE);
392+
abstractRegistry.subscribe(url2, listener2);
393+
NotifyListener listener3 = urls -> notified.set(Boolean.TRUE);
394394
URL url3 = new URL("dubbo", "192.168.0.3", 2202, parametersConsumer);
395-
abstractRegistry.subscribe(url3, listner3);
395+
abstractRegistry.subscribe(url3, listener3);
396396
List<URL> urls = new ArrayList<>();
397397
urls.add(url1);
398398
urls.add(url2);

dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/AbstractClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ protected void connect() throws RemotingException {
192192

193193
} else {
194194
if (logger.isInfoEnabled()) {
195-
logger.info("Successed connect to server " + getRemoteAddress() + " from " + getClass().getSimpleName() + " "
195+
logger.info("Succeed connect to server " + getRemoteAddress() + " from " + getClass().getSimpleName() + " "
196196
+ NetUtils.getLocalHost() + " using dubbo version " + Version.getVersion()
197197
+ ", channel is " + this.getChannel());
198198
}

dubbo-remoting/dubbo-remoting-etcd3/src/main/java/org/apache/dubbo/remoting/etcd/support/AbstractEtcdClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public abstract class AbstractEtcdClient<WatcherListener> implements EtcdClient
5858
private final Set<StateListener> stateListeners = new ConcurrentHashSet<>();
5959

6060
private final ConcurrentMap<String, ConcurrentMap<ChildListener, WatcherListener>> childListeners = new ConcurrentHashMap<>();
61-
private final List<String> categroies = Arrays.asList(Constants.PROVIDERS_CATEGORY
61+
private final List<String> categories = Arrays.asList(Constants.PROVIDERS_CATEGORY
6262
, Constants.CONSUMERS_CATEGORY
6363
, Constants.ROUTERS_CATEGORY
6464
, Constants.CONFIGURATORS_CATEGORY);
@@ -158,11 +158,11 @@ protected void createParentIfAbsent(String fixedPath) {
158158
int i = fixedPath.lastIndexOf('/');
159159
if (i > 0) {
160160
String parentPath = fixedPath.substring(0, i);
161-
if (categroies.stream().anyMatch(c -> fixedPath.endsWith(c))) {
161+
if (categories.stream().anyMatch(c -> fixedPath.endsWith(c))) {
162162
if (!checkExists(parentPath)) {
163163
this.doCreatePersistent(parentPath);
164164
}
165-
} else if (categroies.stream().anyMatch(c -> parentPath.endsWith(c))) {
165+
} else if (categories.stream().anyMatch(c -> parentPath.endsWith(c))) {
166166
String grandfather = parentPath.substring(0, parentPath.lastIndexOf('/'));
167167
if (!checkExists(grandfather)) {
168168
this.doCreatePersistent(grandfather);

dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AbstractProtocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public abstract class AbstractProtocol implements Protocol {
4040

4141
protected final Map<String, Exporter<?>> exporterMap = new ConcurrentHashMap<String, Exporter<?>>();
4242

43-
//TODO SOFEREFENCE
43+
//TODO SoftReference
4444
protected final Set<Invoker<?>> invokers = new ConcurrentHashSet<Invoker<?>>();
4545

4646
protected static String serviceKey(URL url) {

0 commit comments

Comments
 (0)