Skip to content
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 @@ -127,7 +127,7 @@ else if ("!=".equals(separator)) {
values.add(content);
}
// The Value in the KV part, if Value have more than one items.
else if (",".equals(separator)) { // Should be seperateed by ','
else if (",".equals(separator)) { // Should be separated by ','
if (values == null || values.isEmpty()) {
throw new ParseException("Illegal route rule \""
+ rule + "\", The error char '" + separator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* <p>
* Example URLS used by Script Router Factory:
* <ol>
* <li> script://registyAddress?type=js&rule=xxxx
* <li> script://registryAddress?type=js&rule=xxxx
* <li> script:///path/to/routerfile.js?type=js&rule=xxxx
* <li> script://D:\path\to\routerfile.js?type=js&rule=xxxx
* <li> script://C:/path/to/routerfile.js?type=js&rule=xxxx
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private List<Invoker<T>> selectMockInvoker(Invocation invocation) {
List<Invoker<T>> invokers = null;
//TODO generic invoker?
if (invocation instanceof RpcInvocation) {
//Note the implicit contract (although the description is added to the interface declaration, but extensibility is a problem. The practice placed in the attachement needs to be improved)
//Note the implicit contract (although the description is added to the interface declaration, but extensibility is a problem. The practice placed in the attachment needs to be improved)
((RpcInvocation) invocation).setAttachment(Constants.INVOCATION_NEED_MOCK, Boolean.TRUE.toString());
//directory will return a list of normal invokers if Constants.INVOCATION_NEED_MOCK is present in invocation, otherwise, a list of mock invokers will return.
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,8 @@ public static String getInitCode(Class<?> type) {
public static <K, V> Map<K, V> toMap(Map.Entry<K, V>[] entries) {
Map<K, V> map = new HashMap<K, V>();
if (entries != null && entries.length > 0) {
for (Map.Entry<K, V> enrty : entries) {
map.put(enrty.getKey(), enrty.getValue());
for (Map.Entry<K, V> entry : entries) {
map.put(entry.getKey(), entry.getValue());
}
}
return map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ public synchronized void mark(int readlimit) {
@Override
public synchronized void reset() throws IOException {
if (!mInMarked) {
throw new IOException("should mark befor reset!");
throw new IOException("should mark before reset!");
}

mInReset = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.io.InputStream;

/**
* UnsafeByteArrayInputStrem.
* UnsafeByteArrayInputStream.
*/
public class UnsafeByteArrayInputStream extends InputStream {
protected byte mData[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public static void notNull(Object obj, String message) {
}
}

public static void notNull(Object obj, RuntimeException exeception) {
public static void notNull(Object obj, RuntimeException exception) {
if (obj == null) {
throw exeception;
throw exception;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public static Properties loadProperties(String fileName, boolean allowMultiFile)
* <li>return empty Properties if no file found.
* <li>merge multi properties file if found multi file
* </ul>
* @throws IllegalStateException not allow multi-file, but multi-file exsit on class path.
* @throws IllegalStateException not allow multi-file, but multi-file exist on class path.
*/
public static Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional) {
Properties properties = new Properties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ private static Object generalize(Object pojo, Map<Object, Object> history) {
try {
Object fieldValue = field.get(pojo);
if (history.containsKey(pojo)) {
Object pojoGenerilizedValue = history.get(pojo);
if (pojoGenerilizedValue instanceof Map
&& ((Map) pojoGenerilizedValue).containsKey(field.getName())) {
Object pojoGeneralizedValue = history.get(pojo);
if (pojoGeneralizedValue instanceof Map
&& ((Map) pojoGeneralizedValue).containsKey(field.getName())) {
continue;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class CommandContext extends org.apache.dubbo.qos.command.CommandContext
public CommandContext(org.apache.dubbo.qos.command.CommandContext context) {
super(context.getCommandName(), context.getArgs(), context.isHttp());
setRemote(context.getRemote());
setOrginRequest(context.getOrginRequest());
setOriginRequest(context.getOriginRequest());
}

public CommandContext(String commandName) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private BeanNameGenerator resolveBeanNameGenerator(BeanDefinitionRegistry regist
* {@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ private <T> T getFieldValue(Object object, String fieldName, Class<T> fieldType)
/**
* Generate a key based on the annotation.
*
* @param annotations annotatoin value
* @param annotations annotation value
* @return unique key, never null will be returned.
* @since 2.7.0
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private BeanNameGenerator resolveBeanNameGenerator(BeanDefinitionRegistry regist
* {@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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Cache interface to support storing and retrieval of value against a lookup key. It has two operation <b>get</b> and <b>put</b>.
* <li><b>put</b>-Storing value against a key.</li>
* <li><b>get</b>-Retrival of object.</li>
* <li><b>get</b>-Retrieval of object.</li>
* @see org.apache.dubbo.cache.support.lru.LruCache
* @see org.apache.dubbo.cache.support.jcache.JCache
* @see org.apache.dubbo.cache.support.expiring.ExpiringCache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CommandContext {
private String[] args;
private Channel remote;
private boolean isHttp;
private Object orginRequest;
private Object originRequest;

public CommandContext(String commandName) {
this.commandName = commandName;
Expand Down Expand Up @@ -68,11 +68,11 @@ public void setHttp(boolean http) {
isHttp = http;
}

public Object getOrginRequest() {
return orginRequest;
public Object getOriginRequest() {
return originRequest;
}

public void setOrginRequest(Object orginRequest) {
this.orginRequest = orginRequest;
public void setOriginRequest(Object originRequest) {
this.originRequest = originRequest;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static final CommandContext decode(String str) {
String[] targetArgs = new String[array.length - 1];
System.arraycopy(array, 1, targetArgs, 0, array.length - 1);
commandContext = CommandContextFactory.newInstance( name, targetArgs,false);
commandContext.setOrginRequest(str);
commandContext.setOriginRequest(str);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ public class CommandContextTest {
public void test() throws Exception {
CommandContext context = new CommandContext("test", new String[]{"hello"}, true);
Object request = new Object();
context.setOrginRequest(request);
context.setOriginRequest(request);
Channel channel = Mockito.mock(Channel.class);
context.setRemote(channel);
assertThat(context.getCommandName(), equalTo("test"));
assertThat(context.getArgs(), arrayContaining("hello"));
assertThat(context.getOrginRequest(), is(request));
assertThat(context.getOriginRequest(), is(request));
assertTrue(context.isHttp());
assertThat(context.getRemote(), is(channel));

context = new CommandContext("command");
context.setRemote(channel);
context.setOrginRequest(request);
context.setOriginRequest(request);
context.setArgs(new String[]{"world"});
context.setHttp(false);
assertThat(context.getCommandName(), equalTo("command"));
assertThat(context.getArgs(), arrayContaining("world"));
assertThat(context.getOrginRequest(), is(request));
assertThat(context.getOriginRequest(), is(request));
assertFalse(context.isHttp());
assertThat(context.getRemote(), is(channel));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ private void destroyUnusedInvokers(Map<String, Invoker<T>> oldUrlInvokerMap, Map
logger.debug("destroy invoker[" + invoker.getUrl() + "] success. ");
}
} catch (Exception e) {
logger.warn("destroy invoker[" + invoker.getUrl() + "] faild. " + e.getMessage(), e);
logger.warn("destroy invoker[" + invoker.getUrl() + "] failed. " + e.getMessage(), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void unregister(URL url) {
}
throw new IllegalStateException("Failed to unregister " + url + " to registry " + getUrl().getAddress() + ", cause: " + t.getMessage(), t);
} else {
logger.error("Failed to uregister " + url + ", waiting for retry, cause: " + t.getMessage(), t);
logger.error("Failed to unregister " + url + ", waiting for retry, cause: " + t.getMessage(), t);
}

// Record a failed registration request to a failed list, retry regularly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class Response {
public static final byte OK = 20;

/**
* clien side timeout.
* client side timeout.
*/
public static final byte CLIENT_TIMEOUT = 30;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ private void invokeCallback(ResponseCallback c) {
try {
callbackCopy.done(res.getResult());
} catch (Exception e) {
logger.error("callback invoke error .reasult:" + res.getResult() + ",url:" + channel.getUrl(), e);
logger.error("callback invoke error .result:" + res.getResult() + ",url:" + channel.getUrl(), e);
}
} else if (res.getStatus() == Response.CLIENT_TIMEOUT || res.getStatus() == Response.SERVER_TIMEOUT) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void connected(Channel ch) throws RemotingException {
public void disconnected(Channel ch) throws RemotingException {
Collection<Channel> channels = getChannels();
if (channels.isEmpty()) {
logger.warn("All clients has discontected from " + ch.getLocalAddress() + ". You can graceful shutdown now.");
logger.warn("All clients has disconnected from " + ch.getLocalAddress() + ". You can graceful shutdown now.");
}
super.disconnected(ch);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public void readBytes(ChannelBuffer dst) {

@Override
public void readBytes(ChannelBuffer dst, int length) {
// carefule
// careful
if (length > dst.writableBytes()) {
throw new IndexOutOfBoundsException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public void readBytes(ChannelBuffer dst) {

@Override
public void readBytes(ChannelBuffer dst, int length) {
// carefule
// careful
if (length > dst.writableBytes()) {
throw new IndexOutOfBoundsException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public interface AsyncContext {
void write(Object value);

/**
* @return true if the aysnc context is started
* @return true if the async context is started
*/
boolean isAsyncStarted();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class AsyncContextImpl implements AsyncContext {
private static final Logger logger = LoggerFactory.getLogger(AsyncContextImpl.class);

private final AtomicBoolean started = new AtomicBoolean(false);
private final AtomicBoolean stoped = new AtomicBoolean(false);
private final AtomicBoolean stopped = new AtomicBoolean(false);

private CompletableFuture<Object> future;

Expand Down Expand Up @@ -63,7 +63,7 @@ public boolean isAsyncStarted() {

@Override
public boolean stop() {
return stoped.compareAndSet(false, true);
return stopped.compareAndSet(false, true);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.concurrent.ConcurrentMap;

/**
* DefaultTPSLimiter is a default implementation for tps filter. It is an in memory based implementation for stroring
* DefaultTPSLimiter is a default implementation for tps filter. It is an in memory based implementation for storing
* tps information. It internally use
*
* @see org.apache.dubbo.rpc.filter.TpsLimitFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ protected Result doInvoke(final Invocation invocation) throws Throwable {

Result result;
if (isAsyncFuture) {
// register resultCallback, sometimes we need the asyn result being processed by the filter chain.
// register resultCallback, sometimes we need the async result being processed by the filter chain.
result = new AsyncRpcResult(futureAdapter, futureAdapter.getResultFuture(), false);
} else {
result = new SimpleAsyncRpcResult(futureAdapter, futureAdapter.getResultFuture(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
final class ReferenceCountExchangeClient implements ExchangeClient {

private final URL url;
private final AtomicInteger refenceCount = new AtomicInteger(0);
private final AtomicInteger referenceCount = new AtomicInteger(0);

// private final ExchangeHandler handler;
private final ConcurrentMap<String, LazyConnectExchangeClient> ghostClientMap;
Expand All @@ -45,7 +45,7 @@ final class ReferenceCountExchangeClient implements ExchangeClient {

public ReferenceCountExchangeClient(ExchangeClient client, ConcurrentMap<String, LazyConnectExchangeClient> ghostClientMap) {
this.client = client;
refenceCount.incrementAndGet();
referenceCount.incrementAndGet();
this.url = client.getUrl();
if (ghostClientMap == null) {
throw new IllegalStateException("ghostClientMap can not be null, url: " + url);
Expand Down Expand Up @@ -148,7 +148,7 @@ public void close() {

@Override
public void close(int timeout) {
if (refenceCount.decrementAndGet() <= 0) {
if (referenceCount.decrementAndGet() <= 0) {
if (timeout == 0) {
client.close();
} else {
Expand Down Expand Up @@ -189,6 +189,6 @@ public boolean isClosed() {
}

public void incrementAndGetCount() {
refenceCount.incrementAndGet();
referenceCount.incrementAndGet();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public String telnet(Channel channel, String message) {
detail = true;
} else {
if (service != null && service.length() > 0) {
return "Invaild parameter " + part;
return "Invalid parameter " + part;
}
service = part;
}
Expand Down