Fix typos in comments in elasticsearch/common.

This commit is contained in:
Dongjoon Hyun 2016-02-10 10:29:54 -08:00
parent 374ecea435
commit 06e7c9c005
21 changed files with 28 additions and 28 deletions

View File

@ -93,7 +93,7 @@ import java.util.Locale;
* <a href="http://www.faqs.org/rfcs/rfc3548.html">RFC3548</a>.</li>
* <li><em>Throws exceptions instead of returning null values.</em> Because some operations
* (especially those that may permit the GZIP option) use IO streams, there
* is a possiblity of an java.io.IOException being thrown. After some discussion and
* is a possibility of an java.io.IOException being thrown. After some discussion and
* thought, I've changed the behavior of the methods to throw java.io.IOExceptions
* rather than return null if ever there's an error. I think this is more
* appropriate, though it will require some changes to your code. Sorry,
@ -1511,7 +1511,7 @@ public class Base64 {
if (suspendEncoding) {
this.out.write(theByte);
return;
} // end if: supsended
} // end if: suspended
// Encode?
if (encode) {
@ -1565,7 +1565,7 @@ public class Base64 {
if (suspendEncoding) {
this.out.write(theBytes, off, len);
return;
} // end if: supsended
} // end if: suspended
for (int i = 0; i < len; i++) {
write(theBytes[off + i]);

View File

@ -147,7 +147,7 @@ public class PagedBytesReference implements BytesReference {
bytearray.get(offset, length, ref);
// undo the single-page optimization by ByteArray.get(), otherwise
// a materialized stream will contain traling garbage/zeros
// a materialized stream will contain trailing garbage/zeros
byte[] result = ref.bytes;
if (result.length != length || ref.offset != 0) {
result = Arrays.copyOfRange(result, ref.offset, ref.offset + length);
@ -403,7 +403,7 @@ public class PagedBytesReference implements BytesReference {
return -1;
}
final int numBytesToCopy = Math.min(len, length - pos); // copy the full lenth or the remaining part
final int numBytesToCopy = Math.min(len, length - pos); // copy the full length or the remaining part
// current offset into the underlying ByteArray
long byteArrayOffset = offset + pos;

View File

@ -33,7 +33,7 @@ package org.elasticsearch.common.component;
* following logic can be applied:
* <pre>
* public void stop() {
* if (!lifeccycleState.moveToStopped()) {
* if (!lifecycleState.moveToStopped()) {
* return;
* }
* // continue with stop logic
@ -50,7 +50,7 @@ package org.elasticsearch.common.component;
* if (!lifecycleState.moveToClosed()) {
* return;
* }
* // perofrm close logic here
* // perform close logic here
* }
* </pre>
*/

View File

@ -124,7 +124,7 @@ public abstract class CompressedIndexInput extends IndexInput {
@Override
public void readBytes(byte[] b, int offset, int len) throws IOException {
int result = read(b, offset, len, true /* we want to have full reads, thats the contract... */);
int result = read(b, offset, len, true /* we want to have full reads, that's the contract... */);
if (result < len) {
throw new EOFException();
}

View File

@ -121,7 +121,7 @@ public abstract class CompressedStreamInput extends StreamInput {
@Override
public void readBytes(byte[] b, int offset, int len) throws IOException {
int result = read(b, offset, len, true /* we want to have full reads, thats the contract... */);
int result = read(b, offset, len, true /* we want to have full reads, that's the contract... */);
if (result < len) {
throw new EOFException();
}

View File

@ -52,7 +52,7 @@ public class DeflateCompressor implements Compressor {
private static final byte[] HEADER = new byte[] { 'D', 'F', 'L', '\0' };
// 3 is a good trade-off between speed and compression ratio
private static final int LEVEL = 3;
// We use buffering on the input and ouput of in/def-laters in order to
// We use buffering on the input and output of in/def-laters in order to
// limit the number of JNI calls
private static final int BUFFER_SIZE = 4096;

View File

@ -24,7 +24,7 @@ import java.lang.annotation.Target;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Acccompanies a {@literal @}{@link org.elasticsearch.common.inject.Provides Provides} method annotation in a
* Accompanies a {@literal @}{@link org.elasticsearch.common.inject.Provides Provides} method annotation in a
* private module to indicate that the provided binding is exposed.
*
* @author jessewilson@google.com (Jesse Wilson)

View File

@ -489,7 +489,7 @@ class InjectorImpl implements Injector, Lookups {
ParameterizedType parameterizedType = (ParameterizedType) typeLiteralType;
Type innerType = parameterizedType.getActualTypeArguments()[0];
// this is unforunate. We don't support building TypeLiterals for type variable like 'T'. If
// this is unfortunate. We don't support building TypeLiterals for type variable like 'T'. If
// this proves problematic, we can probably fix TypeLiteral to support type variables
if (!(innerType instanceof Class)
&& !(innerType instanceof GenericArrayType)

View File

@ -41,7 +41,7 @@ import java.util.Objects;
* TypeLiteral}.
* <p>
* Keys do not differentiate between primitive types (int, char, etc.) and
* their correpsonding wrapper types (Integer, Character, etc.). Primitive
* their corresponding wrapper types (Integer, Character, etc.). Primitive
* types will be replaced with their wrapper types when keys are created.
*
* @author crazybob@google.com (Bob Lee)

View File

@ -30,7 +30,7 @@ import java.util.List;
import java.util.Set;
/**
* Internal respresentation of a constructor annotated with
* Internal representation of a constructor annotated with
* {@link AssistedInject}
*
* @author jmourits@google.com (Jerome Mourits)

View File

@ -24,7 +24,7 @@ import java.util.Arrays;
import java.util.List;
/**
* A list of {@link TypeLiteral}s to match an injectable Constructor's assited
* A list of {@link TypeLiteral}s to match an injectable Constructor's assisted
* parameter types to the corresponding factory method.
*
* @author jmourits@google.com (Jerome Mourits)

View File

@ -91,7 +91,7 @@ public final class Dependency<T> {
/**
* Returns the index of this dependency in the injection point's parameter list, or {@code -1} if
* this dependency does not belong to a parameter list. Only method and constuctor dependencies
* this dependency does not belong to a parameter list. Only method and constructor dependencies
* are elements in a parameter list.
*/
public int getParameterIndex() {

View File

@ -125,7 +125,7 @@ public final class InjectionPoint {
return Collections.unmodifiableList(dependencies);
}
// This metohd is necessary to create a Dependency<T> with proper generic type information
// This method is necessary to create a Dependency<T> with proper generic type information
private <T> Dependency<T> newDependency(Key<T> key, boolean allowsNull, int parameterIndex) {
return new Dependency<>(this, key, allowsNull, parameterIndex);
}

View File

@ -34,7 +34,7 @@ import java.util.Objects;
*/
public final class ProviderLookup<T> implements Element {
// NOTE: this class is not part of guice and was added so the provder lookup's key can be acessible for tests
// NOTE: this class is not part of guice and was added so the provider lookup's key can be accessible for tests
public static class ProviderImpl<T> implements Provider<T> {
private ProviderLookup<T> lookup;

View File

@ -28,7 +28,7 @@ import java.io.IOException;
/**
* This exception can be used to wrap a given, not serializable exception
* to serialize via {@link StreamOutput#writeThrowable(Throwable)}.
* This class will perserve the stacktrace as well as the suppressed exceptions of
* This class will preserve the stacktrace as well as the suppressed exceptions of
* the throwable it was created with instead of it's own. The stacktrace has no indication
* of where this exception was created.
*/

View File

@ -627,7 +627,7 @@ public class Lucene {
}
/**
* Parses the version string lenient and returns the the default value if the given string is null or emtpy
* Parses the version string lenient and returns the default value if the given string is null or emtpy
*/
public static Version parseVersionLenient(String toParse, Version defaultValue) {
return LenientParser.parse(toParse, defaultValue);

View File

@ -21,7 +21,7 @@ package org.elasticsearch.common.recycler;
abstract class FilterRecycler<T> implements Recycler<T> {
/** Get the delegate instance to foward calls to. */
/** Get the delegate instance to forward calls to. */
protected abstract Recycler<T> getDelegate();
/** Wrap a recycled reference. */

View File

@ -47,7 +47,7 @@ import java.util.stream.Collectors;
* A setting. Encapsulates typical stuff like default value, parsing, and scope.
* Some (dynamic=true) can by modified at run time using the API.
* All settings inside elasticsearch or in any of the plugins should use this type-safe and generic settings infrastructure
* together with {@link AbstractScopedSettings}. This class contains several untility methods that makes it straight forward
* together with {@link AbstractScopedSettings}. This class contains several utility methods that makes it straight forward
* to add settings for the majority of the cases. For instance a simple boolean settings can be defined like this:
* <pre>{@code
* public static final Setting<Boolean>; MY_BOOLEAN = Setting.boolSetting("my.bool.setting", true, false, Scope.CLUSTER);}

View File

@ -471,7 +471,7 @@ public final class Settings implements ToXContent {
/**
* Returns the setting value (as size) associated with the setting key. Provided values can either be
* absolute values (intepreted as a number of bytes), byte sizes (eg. 1mb) or percentage of the heap size
* absolute values (interpreted as a number of bytes), byte sizes (eg. 1mb) or percentage of the heap size
* (eg. 12%). If it does not exists, parses the default value provided.
*/
public ByteSizeValue getAsMemory(String setting, String defaultValue) throws SettingsException {
@ -480,7 +480,7 @@ public final class Settings implements ToXContent {
/**
* Returns the setting value (as size) associated with the setting key. Provided values can either be
* absolute values (intepreted as a number of bytes), byte sizes (eg. 1mb) or percentage of the heap size
* absolute values (interpreted as a number of bytes), byte sizes (eg. 1mb) or percentage of the heap size
* (eg. 12%). If it does not exists, parses the default value provided.
*/
public ByteSizeValue getAsMemory(String[] settings, String defaultValue) throws SettingsException {

View File

@ -112,7 +112,7 @@ abstract class AbstractPagedHashMap implements Releasable {
}
}
// The only entries which have not been put in their final position in the previous loop are those that were stored in a slot that
// is < slot(key, mask). This only happens when slot(key, mask) returned a slot that was close to the end of the array and colision
// is < slot(key, mask). This only happens when slot(key, mask) returned a slot that was close to the end of the array and collision
// resolution has put it back in the first slots. This time, collision resolution will have put them at the beginning of the newly
// allocated slots. Let's re-add them to make sure they are in the right slot. This 2nd loop will typically exit very early.
for (long i = buckets; i < newBuckets; ++i) {

View File

@ -78,7 +78,7 @@ public abstract class ExtensionPoint {
/**
* Creates a new {@link ClassMap}
*
* @param name the human readable underscore case name of the extension poing. This is used in error messages etc.
* @param name the human readable underscore case name of the extension point. This is used in error messages etc.
* @param extensionClass the base class that should be extended
* @param singletons a list of singletons to bind with this extension point - these are bound in {@link #bind(Binder)}
* @param reservedKeys a set of reserved keys by internal implementations
@ -120,7 +120,7 @@ public abstract class ExtensionPoint {
}
/**
* A Type extension point which basically allows to registerd keyed extensions like {@link ClassMap}
* A Type extension point which basically allows to registered keyed extensions like {@link ClassMap}
* but doesn't instantiate and bind all the registered key value pairs but instead replace a singleton based on a given setting via {@link #bindType(Binder, Settings, String, String)}
* Note: {@link #bind(Binder)} is not supported by this class
*/
@ -169,7 +169,7 @@ public abstract class ExtensionPoint {
/**
* Creates a new {@link ClassSet}
*
* @param name the human readable underscore case name of the extension poing. This is used in error messages etc.
* @param name the human readable underscore case name of the extension point. This is used in error messages etc.
* @param extensionClass the base class that should be extended
* @param singletons a list of singletons to bind with this extension point - these are bound in {@link #bind(Binder)}
*/