fix some typo (#7495)

This commit is contained in:
Wu Zhiguo 2021-04-01 19:33:21 +08:00 committed by GitHub
parent 790dfce51a
commit 0ddc9889de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 72 additions and 72 deletions

View File

@ -25,7 +25,7 @@ import org.apache.dubbo.rpc.Invoker;
* A ClusterInvoker holds a group of normal invokers, stored in a Directory, mapping to one Registry.
* The ClusterInvoker implementation usually provides LB or HA policies, like FailoverClusterInvoker.
* <p>
* In multi-registry subscription scenario, the final ClusterInvoker will referr to several sub ClusterInvokers, with each
* In multi-registry subscription scenario, the final ClusterInvoker will refer to several sub ClusterInvokers, with each
* sub ClusterInvoker representing one Registry. Take ZoneAwareClusterInvoker as an example, it is specially customized for
* multi-registry use cases: first, pick up one ClusterInvoker, then do LB inside the chose ClusterInvoker.
*

View File

@ -241,7 +241,7 @@ public class AdaptiveClassCodeGenerator {
}
/**
* generate extName assigment code
* generate extName assignment code
*/
private String generateExtNameAssignment(String[] value, boolean hasInvocation) {
// TODO: refactor it

View File

@ -314,7 +314,7 @@ public class JSON {
break;
}
default:
throw new ParseException("Unexcepted token expect [ VALUE or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
throw new ParseException("Unexpected token expect [ VALUE or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
}
break;
}
@ -362,7 +362,7 @@ public class JSON {
break;
}
default:
throw new ParseException("Unexcepted token expect [ VALUE or ',' or ']' or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
throw new ParseException("Unexpected token expect [ VALUE or ',' or ']' or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
}
break;
}
@ -401,7 +401,7 @@ public class JSON {
break;
}
default:
throw new ParseException("Unexcepted token expect [ IDENT or VALUE or ',' or '}' ] get '" + JSONToken.token2string(token.type) + "'");
throw new ParseException("Unexpected token expect [ IDENT or VALUE or ',' or '}' ] get '" + JSONToken.token2string(token.type) + "'");
}
break;
}
@ -439,12 +439,12 @@ public class JSON {
break;
}
default:
throw new ParseException("Unexcepted token expect [ VALUE or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
throw new ParseException("Unexpected token expect [ VALUE or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
}
break;
}
default:
throw new ParseException("Unexcepted state.");
throw new ParseException("Unexpected state.");
}
}
while ((token = jr.nextToken()) != null);
@ -509,7 +509,7 @@ public class JSON {
break;
}
default:
throw new ParseException("Unexcepted token expect [ VALUE or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
throw new ParseException("Unexpected token expect [ VALUE or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
}
break;
}
@ -585,7 +585,7 @@ public class JSON {
break;
}
default:
throw new ParseException("Unexcepted token expect [ VALUE or ',' or ']' or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
throw new ParseException("Unexpected token expect [ VALUE or ',' or ']' or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
}
break;
}
@ -636,7 +636,7 @@ public class JSON {
break;
}
default:
throw new ParseException("Unexcepted token expect [ IDENT or VALUE or ',' or '}' ] get '" + JSONToken.token2string(token.type) + "'");
throw new ParseException("Unexpected token expect [ IDENT or VALUE or ',' or '}' ] get '" + JSONToken.token2string(token.type) + "'");
}
break;
}
@ -686,12 +686,12 @@ public class JSON {
break;
}
default:
throw new ParseException("Unexcepted token expect [ VALUE or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
throw new ParseException("Unexpected token expect [ VALUE or '[' or '{' ] get '" + JSONToken.token2string(token.type) + "'");
}
break;
}
default:
throw new ParseException("Unexcepted state.");
throw new ParseException("Unexpected state.");
}
}
while ((token = jr.nextToken()) != null);

View File

@ -219,7 +219,7 @@ public class ReferenceConfig<T> extends ReferenceConfigBase<T> {
try {
invoker.destroy();
} catch (Throwable t) {
logger.warn("Unexpected error occured when destroy invoker of ReferenceConfig(" + url + ").", t);
logger.warn("Unexpected error occurred when destroy invoker of ReferenceConfig(" + url + ").", t);
}
invoker = null;
ref = null;

View File

@ -170,7 +170,7 @@ public class ServiceConfig<T> extends ServiceConfigBase<T> {
try {
exporter.unexport();
} catch (Throwable t) {
logger.warn("Unexpected error occured when unexport " + exporter, t);
logger.warn("Unexpected error occurred when unexport " + exporter, t);
}
}
exporters.clear();

View File

@ -81,7 +81,7 @@ import static org.springframework.util.ClassUtils.resolveClassName;
/**
* {@link BeanFactoryPostProcessor} used for processing of {@link Service @Service} annotated classes. it's also the
* infrastructure class of XML {@link BeanDefinitionParser} on &lt;dubbbo:annotation /&gt;
* infrastructure class of XML {@link BeanDefinitionParser} on &lt;dubbo:annotation /&gt;
*
* @see AnnotationBeanDefinitionParser
* @see BeanDefinitionRegistryPostProcessor
@ -239,7 +239,7 @@ public class ServiceClassPostProcessor implements BeanDefinitionRegistryPostProc
* {@link Service} Annotation.
*
* @param scanner {@link ClassPathBeanDefinitionScanner}
* @param packageToScan pachage to scan
* @param packageToScan package to scan
* @param registry {@link BeanDefinitionRegistry}
* @return non-null
* @since 2.5.8

View File

@ -24,7 +24,7 @@ import org.apache.dubbo.config.spring.context.event.DubboBootstrapStopedEvent;
import org.springframework.context.ApplicationContext;
/**
* convcert Dubbo bootstrap event to spring environment.
* convert Dubbo bootstrap event to spring environment.
*
* @scene 2.7.9
*/

View File

@ -29,7 +29,7 @@ import static org.springframework.util.ClassUtils.resolveClassName;
import static org.springframework.util.StringUtils.hasText;
/**
* Dubbbo Annotation Utilities Class
* Dubbo Annotation Utilities Class
*
* @see org.springframework.core.annotation.AnnotationUtils
* @since 2.5.11

View File

@ -62,7 +62,7 @@ public class Main {
for (int i = 0; i < args.length; i++) {
containers.add(LOADER.getExtension(args[i]));
}
logger.info("Use container type(" + Arrays.toString(args) + ") to run dubbo serivce.");
logger.info("Use container type(" + Arrays.toString(args) + ") to run dubbo service.");
if ("true".equals(System.getProperty(SHUTDOWN_HOOK_KEY))) {
Runtime.getRuntime().addShutdownHook(new Thread("dubbo-container-shutdown-hook") {

View File

@ -19,7 +19,7 @@ package org.apache.dubbo.metadata;
public class MetadataConstants {
public static final String KEY_SEPARATOR = ":";
public static final String DEFAULT_PATH_TAG = "metadata";
public static final String KEY_REVISON_PREFIX = "revision";
public static final String KEY_REVISION_PREFIX = "revision";
public static final String META_DATA_STORE_TAG = ".metaData";
public static final String SERVICE_META_DATA_STORE_TAG = ".smd";
public static final String CONSUMER_META_DATA_STORE_TAG = ".cmd";

View File

@ -32,7 +32,7 @@ import static java.util.stream.StreamSupport.stream;
import static org.apache.dubbo.common.URL.buildKey;
/**
* A framework interface of Dubbo Metadata Service defines the contract of Dubbo Services registartion and subscription
* A framework interface of Dubbo Metadata Service defines the contract of Dubbo Services registration and subscription
* between Dubbo service providers and its consumers. The implementation will be exported as a normal Dubbo service that
* the clients would subscribe, whose version comes from the {@link #version()} method and group gets from
* {@link #serviceName()}, that means, The different Dubbo service(application) will export the different

View File

@ -21,7 +21,7 @@ import org.apache.dubbo.common.URL;
import static org.apache.dubbo.common.constants.CommonConstants.GROUP_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.SIDE_KEY;
import static org.apache.dubbo.common.constants.CommonConstants.VERSION_KEY;
import static org.apache.dubbo.metadata.MetadataConstants.KEY_REVISON_PREFIX;
import static org.apache.dubbo.metadata.MetadataConstants.KEY_REVISION_PREFIX;
/**
* The ServiceMetadataIdentifier is used to store the {@link org.apache.dubbo.common.URL}
@ -56,11 +56,11 @@ public class ServiceMetadataIdentifier extends BaseServiceMetadataIdentifier imp
}
public String getUniqueKey(KeyTypeEnum keyType) {
return super.getUniqueKey(keyType, protocol, KEY_REVISON_PREFIX + revision);
return super.getUniqueKey(keyType, protocol, KEY_REVISION_PREFIX + revision);
}
public String getIdentifierKey() {
return super.getIdentifierKey(protocol, KEY_REVISON_PREFIX + revision);
return super.getIdentifierKey(protocol, KEY_REVISION_PREFIX + revision);
}
public void setRevision(String revision) {

View File

@ -41,14 +41,14 @@ import static org.apache.dubbo.metadata.rest.RestMetadataConstants.SERVICE_REST_
*/
public class ClassPathServiceRestMetadataReader implements ServiceRestMetadataReader {
private final String serviceRestMetadataJsonResoucePath;
private final String serviceRestMetadataJsonResourcePath;
public ClassPathServiceRestMetadataReader() {
this(SERVICE_REST_METADATA_RESOURCE_PATH);
}
public ClassPathServiceRestMetadataReader(String serviceRestMetadataJsonResoucePath) {
this.serviceRestMetadataJsonResoucePath = serviceRestMetadataJsonResoucePath;
public ClassPathServiceRestMetadataReader(String serviceRestMetadataJsonResourcePath) {
this.serviceRestMetadataJsonResourcePath = serviceRestMetadataJsonResourcePath;
}
@Override
@ -59,7 +59,7 @@ public class ClassPathServiceRestMetadataReader implements ServiceRestMetadataRe
ClassLoader classLoader = getClass().getClassLoader();
execute(() -> {
Enumeration<URL> resources = classLoader.getResources(serviceRestMetadataJsonResoucePath);
Enumeration<URL> resources = classLoader.getResources(serviceRestMetadataJsonResourcePath);
Gson gson = new Gson();
while (resources.hasMoreElements()) {
URL resource = resources.nextElement();

View File

@ -138,7 +138,7 @@ public class ProtobufTypeBuilder implements TypeBuilder {
Matcher matcher = MAP_PATTERN.matcher(typeName);
if (!matcher.matches()) {
throw new IllegalArgumentException("Map protobuf property " + fieldName + "of Type " +
typeName + " can't be parsed.The type name should mathch[" + MAP_PATTERN.toString() + "].");
typeName + " can't be parsed.The type name should match[" + MAP_PATTERN.toString() + "].");
}
}

View File

@ -78,7 +78,7 @@ public class FailoverMetadataReport extends StrategyMetadataReport {
if (protocol == null || !ExtensionLoader.getExtensionLoader(MetadataReportFactory.class).hasExtension(protocol)) {
throw new IllegalArgumentException(
"No '" + protocol
+ "' medata report extension found, please check if metadata report module dependencies are included.");
+ "' metadata report extension found, please check if metadata report module dependencies are included.");
}
List<URL> urls = new ArrayList<>();

View File

@ -180,7 +180,7 @@ public class ServiceInstancesChangedListener implements ConditionalEventListener
logger.info("Metadata " + metadataInfo.toString());
}
} catch (Exception e) {
logger.error("Failed to load service metadata, metadta type is " + metadataType, e);
logger.error("Failed to load service metadata, metadata type is " + metadataType, e);
metadataInfo = null;
// TODO, load metadata backup. Stop getting metadata after x times of failure for one revision?
}

View File

@ -34,7 +34,7 @@ public interface MetadataServiceURLBuilder {
* Build the {@link URL URLs} from the specified {@link ServiceInstance}
*
* @param serviceInstance {@link ServiceInstance}
* @return TODO, usually, we generate one metadata url from one instance. There's no scenario to return a metadta url list.
* @return TODO, usually, we generate one metadata url from one instance. There's no scenario to return a metadata url list.
*/
List<URL> build(ServiceInstance serviceInstance);
}

View File

@ -216,7 +216,7 @@ public class InMemoryWritableMetadataService implements WritableMetadataService
try {
metadataSemaphore.acquire();
} catch (InterruptedException e) {
logger.warn("metadata refresh thread has been interrupted unexpectedly while wating for update.", e);
logger.warn("metadata refresh thread has been interrupted unexpectedly while waiting for update.", e);
}
}

View File

@ -71,7 +71,7 @@ public class MultipleRegistry extends AbstractRegistry {
this.applicationName = url.getParameter(CommonConstants.APPLICATION_KEY);
init();
checkApplicationName(this.applicationName);
// This urls contain parameter and it donot inherit from the parameter of url in MultipleRegistry
// This urls contain parameter and it do not inherit from the parameter of url in MultipleRegistry
Map<String, Registry> registryMap = new HashMap<>();
if (initServiceRegistry) {

View File

@ -81,7 +81,7 @@ public interface EtcdClient {
* register children listener for specified path.
*
* @param path the path to be watched when children is added, delete or update.
* @param listener when children is changed , listener will be trigged.
* @param listener when children is changed , listener will be triggered.
* @return direct children directory, contains zero element
* list if children directory not exists.
*/
@ -91,7 +91,7 @@ public interface EtcdClient {
* find watcher of the children listener for specified path.
*
* @param path the path to be watched when children is added, delete or update.
* @param listener when children is changed , listener will be trigged.
* @param listener when children is changed , listener will be triggered.
* @return watcher if find else null
*/
<T> T getChildListener(String path, ChildListener listener);
@ -100,7 +100,7 @@ public interface EtcdClient {
* unregister children lister for specified path.
*
* @param path the path to be unwatched .
* @param listener when children is changed , lister will be trigged.
* @param listener when children is changed , lister will be triggered.
*/
void removeChildListener(String path, ChildListener listener);

View File

@ -17,7 +17,6 @@
package org.apache.dubbo.remoting.etcd.jetcd;
import java.nio.charset.StandardCharsets;
import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
@ -49,6 +48,7 @@ import io.grpc.stub.StreamObserver;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
@ -500,7 +500,7 @@ public class JEtcdClientWrapper {
/**
* because jetcd's connection change callback not supported yet, we must
* loop to test if connect or disconnect event happend or not. It will be changed
* loop to test if connect or disconnect event happened or not. It will be changed
* in the future if we found better choice.
*/
public void start() {
@ -596,7 +596,7 @@ public class JEtcdClientWrapper {
}
/**
* try get client's shared channel, becase all fields is private on jetcd,
* try get client's shared channel, because all fields is private on jetcd,
* we must using it by reflect, in the future, jetcd may provider better tools.
*
* @param client get channel from current client
@ -623,9 +623,9 @@ public class JEtcdClientWrapper {
this.connectionStateListener = connectionStateListener;
}
public static void requiredNotNull(Object obj, RuntimeException exeception) {
public static void requiredNotNull(Object obj, RuntimeException exception) {
if (obj == null) {
throw exeception;
throw exception;
}
}

View File

@ -197,7 +197,7 @@ final class MessageFormatter {
throwableCandidate);
}
} else {
if (isEscapedDelimeter(messagePattern, j)) {
if (isEscapedDelimiter(messagePattern, j)) {
if (!isDoubleEscaped(messagePattern, j)) {
l--; // DELIM_START was escaped, thus should not be incremented
sbuf.append(messagePattern, i, j - 1);
@ -228,18 +228,18 @@ final class MessageFormatter {
}
}
static boolean isEscapedDelimeter(String messagePattern,
int delimeterStartIndex) {
static boolean isEscapedDelimiter(String messagePattern,
int delimiterStartIndex) {
if (delimeterStartIndex == 0) {
if (delimiterStartIndex == 0) {
return false;
}
return messagePattern.charAt(delimeterStartIndex - 1) == ESCAPE_CHAR;
return messagePattern.charAt(delimiterStartIndex - 1) == ESCAPE_CHAR;
}
static boolean isDoubleEscaped(String messagePattern,
int delimeterStartIndex) {
return delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR;
int delimiterStartIndex) {
return delimiterStartIndex >= 2 && messagePattern.charAt(delimiterStartIndex - 2) == ESCAPE_CHAR;
}
// special treatment of array values was suggested by 'lizongbo'

View File

@ -37,9 +37,9 @@ public class MulticastExchangeGroup extends AbstractExchangeGroup {
private static final String LEAVE = "leave";
private InetAddress mutilcastAddress;
private InetAddress multicastAddress;
private MulticastSocket mutilcastSocket;
private MulticastSocket multicastSocket;
public MulticastExchangeGroup(URL url) {
super(url);
@ -47,10 +47,10 @@ public class MulticastExchangeGroup extends AbstractExchangeGroup {
throw new IllegalArgumentException("Invalid multicast address " + url.getHost() + ", scope: 224.0.0.0 - 239.255.255.255");
}
try {
mutilcastAddress = InetAddress.getByName(url.getHost());
mutilcastSocket = new MulticastSocket(url.getPort());
mutilcastSocket.setLoopbackMode(false);
mutilcastSocket.joinGroup(mutilcastAddress);
multicastAddress = InetAddress.getByName(url.getHost());
multicastSocket = new MulticastSocket(url.getPort());
multicastSocket.setLoopbackMode(false);
multicastSocket.joinGroup(multicastAddress);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
@ -58,7 +58,7 @@ public class MulticastExchangeGroup extends AbstractExchangeGroup {
DatagramPacket recv = new DatagramPacket(buf, buf.length);
while (true) {
try {
mutilcastSocket.receive(recv);
multicastSocket.receive(recv);
MulticastExchangeGroup.this.receive(new String(recv.getData()).trim(), (InetSocketAddress) recv.getSocketAddress());
} catch (Exception e) {
logger.error(e.getMessage(), e);
@ -74,9 +74,9 @@ public class MulticastExchangeGroup extends AbstractExchangeGroup {
}
private void send(String msg) throws RemotingException {
DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(), mutilcastAddress, mutilcastSocket.getLocalPort());
DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(), multicastAddress, multicastSocket.getLocalPort());
try {
mutilcastSocket.send(hi);
multicastSocket.send(hi);
} catch (IOException e) {
throw new IllegalStateException(e.getMessage(), e);
}

View File

@ -37,9 +37,9 @@ public class MulticastGroup extends AbstractGroup {
private static final String LEAVE = "leave";
private InetAddress mutilcastAddress;
private InetAddress multicastAddress;
private MulticastSocket mutilcastSocket;
private MulticastSocket multicastSocket;
public MulticastGroup(URL url) {
super(url);
@ -47,10 +47,10 @@ public class MulticastGroup extends AbstractGroup {
throw new IllegalArgumentException("Invalid multicast address " + url.getHost() + ", scope: 224.0.0.0 - 239.255.255.255");
}
try {
mutilcastAddress = InetAddress.getByName(url.getHost());
mutilcastSocket = new MulticastSocket(url.getPort());
mutilcastSocket.setLoopbackMode(false);
mutilcastSocket.joinGroup(mutilcastAddress);
multicastAddress = InetAddress.getByName(url.getHost());
multicastSocket = new MulticastSocket(url.getPort());
multicastSocket.setLoopbackMode(false);
multicastSocket.joinGroup(multicastAddress);
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
@ -58,7 +58,7 @@ public class MulticastGroup extends AbstractGroup {
DatagramPacket recv = new DatagramPacket(buf, buf.length);
while (true) {
try {
mutilcastSocket.receive(recv);
multicastSocket.receive(recv);
MulticastGroup.this.receive(new String(recv.getData()).trim(), (InetSocketAddress) recv.getSocketAddress());
} catch (Exception e) {
logger.error(e.getMessage(), e);
@ -74,9 +74,9 @@ public class MulticastGroup extends AbstractGroup {
}
private void send(String msg) throws RemotingException {
DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(), mutilcastAddress, mutilcastSocket.getLocalPort());
DatagramPacket hi = new DatagramPacket(msg.getBytes(), msg.length(), multicastAddress, multicastSocket.getLocalPort());
try {
mutilcastSocket.send(hi);
multicastSocket.send(hi);
} catch (IOException e) {
throw new IllegalStateException(e.getMessage(), e);
}

View File

@ -43,7 +43,7 @@ public abstract class AbstractZookeeperTransporter implements ZookeeperTransport
private final Map<String, ZookeeperClient> zookeeperClientMap = new ConcurrentHashMap<>();
/**
* share connnect for registry, metadata, etc..
* share connect for registry, metadata, etc..
* <p>
* Make sure the connection is connected.
*

View File

@ -45,7 +45,7 @@ import static org.apache.dubbo.rpc.Constants.INVOCATION_KEY;
* }
* </pre>
* AsyncRpcResult is a future representing an unfinished RPC call, while AppResponse is the actual return type of this call.
* In theory, AppResponse does'n have to implement the {@link Result} interface, this is done mainly for compatibility purpose.
* In theory, AppResponse doesn't have to implement the {@link Result} interface, this is done mainly for compatibility purpose.
*
* @serial Do not change the class name and properties.
*/

View File

@ -91,7 +91,7 @@ public /**final**/ class RpcException extends RuntimeException {
return code == BIZ_EXCEPTION;
}
public boolean isForbidded() {
public boolean isForbidden() {
return code == FORBIDDEN_EXCEPTION;
}

View File

@ -27,7 +27,7 @@ import java.io.OutputStream;
import static org.apache.dubbo.common.serialize.Constants.PROTOBUF_JSON_SERIALIZATION_ID;
/**
* This serizalization is use for google protobuf generic reference.
* This serialization is use for google protobuf generic reference.
* The entity be transported between client and server by json string.
*/
public class GenericProtobufJsonSerialization implements Serialization {

View File

@ -43,7 +43,7 @@ import static org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncl
import static org.springframework.util.ClassUtils.isPrimitiveOrWrapper;
/**
* Abstract Dubbo Meatadata
* Abstract Dubbo Metadata
*
* @since 2.7.0
*/