Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #1338

Open
wants to merge 3 commits into
base: 2.18
Choose a base branch
from
Open
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 @@ -76,7 +76,7 @@ public final class Base64Variants
* This non-standard variant is usually used when encoded data needs to be
* passed via URLs (such as part of GET request). It differs from the
* base {@link #MIME} variant in multiple ways.
* First, no padding is used: this also means that it generally can not
* First, no padding is used: this also means that it generally cannot
* be written in multiple separate but adjacent chunks (which would not
* be the usual use case in any case). Also, no linefeeds are used (max
* line length set to infinite). And finally, two characters (plus and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
* Marker interface that is to be implemented by data format - specific features.
* Interface used since Java Enums can not extend classes or other Enums, but
* Interface used since Java Enums cannot extend classes or other Enums, but
* they can implement interfaces; and as such we may be able to use limited
* amount of generic functionality.
*<p>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fasterxml/jackson/core/JsonFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -2308,7 +2308,7 @@ protected ContentReference _createContentReference(Object contentAccessor,
* for JSON handling. Problem here is that when adding new functionality
* via factory methods, it is not possible to leave these methods abstract
* (because we are implementing them for JSON); but there is risk that
* sub-classes do not override them all (plus older version can not implement).
* sub-classes do not override them all (plus older version cannot implement).
* So a work-around is to add a check to ensure that factory is still one
* used for JSON; and if not, make base implementation of a factory method fail.
*
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/fasterxml/jackson/core/JsonGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public enum Feature {
* One use case is to avoid problems with Javascript limitations:
* since Javascript standard specifies that all number handling
* should be done using 64-bit IEEE 754 floating point values,
* result being that some 64-bit integer values can not be
* result being that some 64-bit integer values cannot be
* accurately represent (as mantissa is only 51 bit wide).
*<p>
* Feature is disabled by default.
Expand Down Expand Up @@ -828,7 +828,7 @@ public int getOutputBuffered() {
* Default implementation returns false; overridden by data formats
* that do support native Object Ids. Caller is expected to either
* use a non-native notation (explicit property or such), or fail,
* in case it can not use native object ids.
* in case it cannot use native object ids.
*
* @return {@code True} if this generator is capable of writing "native" Object Ids
* (which is typically determined by capabilities of the underlying format),
Expand All @@ -848,7 +848,7 @@ public int getOutputBuffered() {
* Default implementation returns false; overridden by data formats
* that do support native Type Ids. Caller is expected to either
* use a non-native notation (explicit property or such), or fail,
* in case it can not use native type ids.
* in case it cannot use native type ids.
*
* @return {@code True} if this generator is capable of writing "native" Type Ids
* (which is typically determined by capabilities of the underlying format),
Expand Down Expand Up @@ -1299,7 +1299,7 @@ public void writeArray(String[] array, int offset, int length) throws IOExceptio
* Otherwise, write only len characters.
*<p>
* Note: actual length of content available may exceed {@code len} but
* can not be less than it: if not enough content available, a
* cannot be less than it: if not enough content available, a
* {@link JsonGenerationException} will be thrown.
*
* @param reader Reader to use for reading Text value to write
Expand Down Expand Up @@ -1555,7 +1555,7 @@ public void writeRawValue(SerializableString raw) throws IOException {
* encoded, as a complete String value (surrounded by double quotes).
* This method defaults
*<p>
* Note: because JSON Strings can not contain unescaped linefeeds,
* Note: because JSON Strings cannot contain unescaped linefeeds,
* if linefeeds are included (as per last argument), they must be
* escaped. This adds overhead for decoding without improving
* readability.
Expand Down Expand Up @@ -1769,7 +1769,7 @@ public abstract int writeBinary(Base64Variant bv,
* Write method that can be used for custom numeric types that can
* not be (easily?) converted to "standard" Java number types.
* Because numbers are not surrounded by double quotes, regular
* {@link #writeString} method can not be used; nor
* {@link #writeString} method cannot be used; nor
* {@link #writeRaw} because that does not properly handle
* value separators needed in Array or Object contexts.
*<p>
Expand Down Expand Up @@ -1982,7 +1982,7 @@ public WritableTypeId writeTypePrefix(WritableTypeId typeIdDef) throws IOExcepti
typeIdDef.wrapperWritten = true;

Inclusion incl = typeIdDef.include;
// first: can not output "as property" if value not Object; if so, must do "as array"
// first: cannot output "as property" if value not Object; if so, must do "as array"
if ((valueShape != JsonToken.START_OBJECT)
&& incl.requiresObjectContext()) {
typeIdDef.include = incl = WritableTypeId.Inclusion.WRAPPER_ARRAY;
Expand Down
38 changes: 19 additions & 19 deletions src/main/java/com/fasterxml/jackson/core/JsonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public enum Feature {
* Most common reason for disabling this feature is to avoid leaking information about
* internal information; this may be done for security reasons.
* Note that even if source reference is included, only parts of contents are usually
* printed, and not the whole contents. Further, many source reference types can not
* printed, and not the whole contents. Further, many source reference types cannot
* necessarily access contents (like streams), so only type is indicated, not contents.
*<p>
* Since 2.16 feature is <b>disabled</b> by default (before 2.16 it was enabled),
Expand Down Expand Up @@ -888,12 +888,12 @@ public void setCurrentValue(Object v) {
* done after reading all content of interest using parser.
* Content is released by writing it to given stream if possible;
* if underlying input is byte-based it can released, if not (char-based)
* it can not.
* it cannot.
*
* @param out OutputStream to which buffered, undecoded content is written to
*
* @return -1 if the underlying content source is not byte based
* (that is, input can not be sent to {@link OutputStream};
* (that is, input cannot be sent to {@link OutputStream};
* otherwise number of bytes released (0 if there was nothing to release)
*
* @throws IOException if write to stream threw exception
Expand All @@ -909,12 +909,12 @@ public int releaseBuffered(OutputStream out) throws IOException {
* done after reading all content of interest using parser.
* Content is released by writing it to given writer if possible;
* if underlying input is char-based it can released, if not (byte-based)
* it can not.
* it cannot.
*
* @param w Writer to which buffered but unprocessed content is written to
*
* @return -1 if the underlying content source is not char-based
* (that is, input can not be sent to {@link Writer};
* (that is, input cannot be sent to {@link Writer};
* otherwise number of chars released (0 if there was nothing to release)
*
* @throws IOException if write using Writer threw exception
Expand Down Expand Up @@ -1926,7 +1926,7 @@ public short getShortValue() throws IOException
/**
* Numeric accessor that can be called when the current
* token is of type {@link JsonToken#VALUE_NUMBER_INT} and
* it can not be used as a Java long primitive type due to its
* it cannot be used as a Java long primitive type due to its
* magnitude.
* It can also be called for {@link JsonToken#VALUE_NUMBER_FLOAT};
* if so, it is equivalent to calling {@link #getDecimalValue}
Expand Down Expand Up @@ -2146,7 +2146,7 @@ public int readBinaryValue(Base64Variant bv, OutputStream out) throws IOExceptio
* and 1 (true), and Strings are parsed using default Java language integer
* parsing rules.
*<p>
* If representation can not be converted to an int (including structured type
* If representation cannot be converted to an int (including structured type
* markers like start/end Object/Array)
* default value of <b>0</b> will be returned; no exceptions are thrown.
*
Expand All @@ -2167,7 +2167,7 @@ public int getValueAsInt() throws IOException {
* and 1 (true), and Strings are parsed using default Java language integer
* parsing rules.
*<p>
* If representation can not be converted to an int (including structured type
* If representation cannot be converted to an int (including structured type
* markers like start/end Object/Array)
* specified <b>def</b> will be returned; no exceptions are thrown.
*
Expand All @@ -2187,7 +2187,7 @@ public int getValueAsInt() throws IOException {
* and 1 (true), and Strings are parsed using default Java language integer
* parsing rules.
*<p>
* If representation can not be converted to a long (including structured type
* If representation cannot be converted to a long (including structured type
* markers like start/end Object/Array)
* default value of <b>0L</b> will be returned; no exceptions are thrown.
*
Expand All @@ -2208,7 +2208,7 @@ public long getValueAsLong() throws IOException {
* and 1 (true), and Strings are parsed using default Java language integer
* parsing rules.
*<p>
* If representation can not be converted to a long (including structured type
* If representation cannot be converted to a long (including structured type
* markers like start/end Object/Array)
* specified <b>def</b> will be returned; no exceptions are thrown.
*
Expand All @@ -2230,7 +2230,7 @@ public long getValueAsLong(long def) throws IOException {
* and 1.0 (true), and Strings are parsed using default Java language floating
* point parsing rules.
*<p>
* If representation can not be converted to a double (including structured types
* If representation cannot be converted to a double (including structured types
* like Objects and Arrays),
* default value of <b>0.0</b> will be returned; no exceptions are thrown.
*
Expand All @@ -2251,7 +2251,7 @@ public double getValueAsDouble() throws IOException {
* and 1.0 (true), and Strings are parsed using default Java language floating
* point parsing rules.
*<p>
* If representation can not be converted to a double (including structured types
* If representation cannot be converted to a double (including structured types
* like Objects and Arrays),
* specified <b>def</b> will be returned; no exceptions are thrown.
*
Expand All @@ -2273,7 +2273,7 @@ public double getValueAsDouble(double def) throws IOException {
* 0 maps to false
* and Strings 'true' and 'false' map to corresponding values.
*<p>
* If representation can not be converted to a boolean value (including structured types
* If representation cannot be converted to a boolean value (including structured types
* like Objects and Arrays),
* default value of <b>false</b> will be returned; no exceptions are thrown.
*
Expand All @@ -2294,7 +2294,7 @@ public boolean getValueAsBoolean() throws IOException {
* 0 maps to false
* and Strings 'true' and 'false' map to corresponding values.
*<p>
* If representation can not be converted to a boolean value (including structured types
* If representation cannot be converted to a boolean value (including structured types
* like Objects and Arrays),
* specified <b>def</b> will be returned; no exceptions are thrown.
*
Expand All @@ -2314,7 +2314,7 @@ public boolean getValueAsBoolean(boolean def) throws IOException {
* {@link java.lang.String}.
* JSON Strings map naturally; scalar values get converted to
* their textual representation.
* If representation can not be converted to a String value (including structured types
* If representation cannot be converted to a String value (including structured types
* like Objects and Arrays and {@code null} token), default value of
* <b>null</b> will be returned; no exceptions are thrown.
*
Expand All @@ -2334,7 +2334,7 @@ public String getValueAsString() throws IOException {
* {@link java.lang.String}.
* JSON Strings map naturally; scalar values get converted to
* their textual representation.
* If representation can not be converted to a String value (including structured types
* If representation cannot be converted to a String value (including structured types
* like Objects and Arrays and {@code null} token), specified default value
* will be returned; no exceptions are thrown.
*
Expand Down Expand Up @@ -2363,7 +2363,7 @@ public String getValueAsString() throws IOException {
* Default implementation returns true; overridden by data formats
* that do support native Object Ids. Caller is expected to either
* use a non-native notation (explicit property or such), or fail,
* in case it can not use native object ids.
* in case it cannot use native object ids.
*
* @return {@code True} if the format being read supports native Object Ids;
* {@code false} if not
Expand All @@ -2380,7 +2380,7 @@ public String getValueAsString() throws IOException {
* Default implementation returns true; overridden by data formats
* that do support native Type Ids. Caller is expected to either
* use a non-native notation (explicit property or such), or fail,
* in case it can not use native type ids.
* in case it cannot use native type ids.
*
* @return {@code True} if the format being read supports native Type Ids;
* {@code false} if not
Expand Down Expand Up @@ -2454,7 +2454,7 @@ public String getValueAsString() throws IOException {
* Note: this method should NOT be used if the result type is a
* container ({@link java.util.Collection} or {@link java.util.Map}.
* The reason is that due to type erasure, key and value types
* can not be introspected when using this method.
* cannot be introspected when using this method.
*
* @param <T> Nominal type parameter for value type
*
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/fasterxml/jackson/core/JsonToken.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public enum JsonToken

/**
* NOT_AVAILABLE can be returned if {@link JsonParser}
* implementation can not currently return the requested
* implementation cannot currently return the requested
* token (usually next one), or even if any will be
* available, but that may be able to determine this in
* future. This is the case with non-blocking parsers --
* they can not block to wait for more data to parse and
* they cannot block to wait for more data to parse and
* must return something.
*/
NOT_AVAILABLE(null, JsonTokenId.ID_NOT_AVAILABLE),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fasterxml/jackson/core/ObjectCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected ObjectCodec() { }
* Note: this method should NOT be used if the result type is a
* container ({@link java.util.Collection} or {@link java.util.Map}.
* The reason is that due to type erasure, key and value types
* can not be introspected when using this method.
* cannot be introspected when using this method.
*
* @param <T> Nominal parameter for target type
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public enum StreamReadFeature
* Most common reason for disabling this feature is to avoid leaking
* internal information; this may be done for security reasons.
* Note that even if source reference is included, only parts of contents are usually
* printed, and not the whole contents. Further, many source reference types can not
* printed, and not the whole contents. Further, many source reference types cannot
* necessarily access contents (like streams), so only type is indicated, not contents.
*<p>
* Feature is enabled by default, meaning that "source reference" information is passed
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fasterxml/jackson/core/TSFBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public B configure(StreamWriteFeature f, boolean state) {
/* 26-Jun-2018, tatu: This should not be needed here, but due to 2.x limitations,
* we do need to include it or require casting.
* Specifically: since `JsonFactory` (and not `TokenStreamFactory`) is base class
* for all backends, it can not expose JSON-specific builder, but this.
* for all backends, it cannot expose JSON-specific builder, but this.
* So let's select lesser evil(s).
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ protected OutputStream _createDataOutputWrapper(DataOutput out) {
*/
protected InputStream _optimizedStreamFromURL(URL url) throws IOException {
if ("file".equals(url.getProtocol())) {
/* Can not do this if the path refers
/* Cannot do this if the path refers
* to a network drive on windows. This fixes the problem;
* might not be needed on all platforms (NFS?), but should not
* matter a lot: performance penalty of extra wrapping is more
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/fasterxml/jackson/core/base/ParserBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public byte[] getBinaryValue(Base64Variant variant) throws IOException
{
if (_binaryValue == null) {
if (_currToken != JsonToken.VALUE_STRING) {
_reportError("Current token ("+_currToken+") not VALUE_STRING, can not access as binary");
_reportError("Current token ("+_currToken+") not VALUE_STRING, cannot access as binary");
}
ByteArrayBuilder builder = _getByteArrayBuilder();
_decodeBase64(getText(), builder, variant);
Expand Down Expand Up @@ -947,7 +947,7 @@ protected void _parseNumericValue(int expType) throws IOException
_parseSlowFloat(expType);
return;
}
_reportError("Current token (%s) not numeric, can not use numeric value accessors", _currToken);
_reportError("Current token (%s) not numeric, cannot use numeric value accessors", _currToken);
}

// @since 2.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ public void overrideCurrentName(String name) {
// 14-Apr-2015, tatu: Not sure whether this can be supported, and if so,
// what to do with it... Delegation won't work for sure, so let's for
// now throw an exception
throw new UnsupportedOperationException("Can not currently override name during filtering read");
throw new UnsupportedOperationException("Cannot currently override name during filtering read");
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public boolean hasMoreBytes() throws IOException
return false;
}
int amount = _buffer.length - _ptr;
if (amount < 1) { // can not load any more
if (amount < 1) { // cannot load any more
return false;
}
int count = _in.read(_buffer, _ptr, amount);
Expand Down
Loading