Skip to content

Commit 8de5b06

Browse files
authored
Change "can not" -> "cannot" in comments (part of #1338) (#1392)
1 parent a759c0c commit 8de5b06

23 files changed

+55
-55
lines changed

src/main/java/com/fasterxml/jackson/core/Base64Variants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public final class Base64Variants
7676
* This non-standard variant is usually used when encoded data needs to be
7777
* passed via URLs (such as part of GET request). It differs from the
7878
* base {@link #MIME} variant in multiple ways.
79-
* First, no padding is used: this also means that it generally can not
79+
* First, no padding is used: this also means that it generally cannot
8080
* be written in multiple separate but adjacent chunks (which would not
8181
* be the usual use case in any case). Also, no linefeeds are used (max
8282
* line length set to infinite). And finally, two characters (plus and

src/main/java/com/fasterxml/jackson/core/FormatFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/**
66
* Marker interface that is to be implemented by data format - specific features.
7-
* Interface used since Java Enums can not extend classes or other Enums, but
7+
* Interface used since Java Enums cannot extend classes or other Enums, but
88
* they can implement interfaces; and as such we may be able to use limited
99
* amount of generic functionality.
1010
*<p>

src/main/java/com/fasterxml/jackson/core/JsonFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2308,7 +2308,7 @@ protected ContentReference _createContentReference(Object contentAccessor,
23082308
* for JSON handling. Problem here is that when adding new functionality
23092309
* via factory methods, it is not possible to leave these methods abstract
23102310
* (because we are implementing them for JSON); but there is risk that
2311-
* sub-classes do not override them all (plus older version can not implement).
2311+
* sub-classes do not override them all (plus older version cannot implement).
23122312
* So a work-around is to add a check to ensure that factory is still one
23132313
* used for JSON; and if not, make base implementation of a factory method fail.
23142314
*

src/main/java/com/fasterxml/jackson/core/JsonGenerator.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ public enum Feature {
176176
* One use case is to avoid problems with Javascript limitations:
177177
* since Javascript standard specifies that all number handling
178178
* should be done using 64-bit IEEE 754 floating point values,
179-
* result being that some 64-bit integer values can not be
180-
* accurately represent (as mantissa is only 51 bit wide).
179+
* result being that some 64-bit integer values cannot be
180+
* accurately represented (as mantissa is only 51 bit wide).
181181
*<p>
182182
* Feature is disabled by default.
183183
*
@@ -828,7 +828,7 @@ public int getOutputBuffered() {
828828
* Default implementation returns false; overridden by data formats
829829
* that do support native Object Ids. Caller is expected to either
830830
* use a non-native notation (explicit property or such), or fail,
831-
* in case it can not use native object ids.
831+
* in case it cannot use native object ids.
832832
*
833833
* @return {@code True} if this generator is capable of writing "native" Object Ids
834834
* (which is typically determined by capabilities of the underlying format),
@@ -848,7 +848,7 @@ public int getOutputBuffered() {
848848
* Default implementation returns false; overridden by data formats
849849
* that do support native Type Ids. Caller is expected to either
850850
* use a non-native notation (explicit property or such), or fail,
851-
* in case it can not use native type ids.
851+
* in case it cannot use native type ids.
852852
*
853853
* @return {@code True} if this generator is capable of writing "native" Type Ids
854854
* (which is typically determined by capabilities of the underlying format),
@@ -1299,7 +1299,7 @@ public void writeArray(String[] array, int offset, int length) throws IOExceptio
12991299
* Otherwise, write only len characters.
13001300
*<p>
13011301
* Note: actual length of content available may exceed {@code len} but
1302-
* can not be less than it: if not enough content available, a
1302+
* cannot be less than it: if not enough content available, a
13031303
* {@link JsonGenerationException} will be thrown.
13041304
*
13051305
* @param reader Reader to use for reading Text value to write
@@ -1555,7 +1555,7 @@ public void writeRawValue(SerializableString raw) throws IOException {
15551555
* encoded, as a complete String value (surrounded by double quotes).
15561556
* This method defaults
15571557
*<p>
1558-
* Note: because JSON Strings can not contain unescaped linefeeds,
1558+
* Note: because JSON Strings cannot contain unescaped linefeeds,
15591559
* if linefeeds are included (as per last argument), they must be
15601560
* escaped. This adds overhead for decoding without improving
15611561
* readability.
@@ -1769,7 +1769,7 @@ public abstract int writeBinary(Base64Variant bv,
17691769
* Write method that can be used for custom numeric types that can
17701770
* not be (easily?) converted to "standard" Java number types.
17711771
* Because numbers are not surrounded by double quotes, regular
1772-
* {@link #writeString} method can not be used; nor
1772+
* {@link #writeString} method cannot be used; nor
17731773
* {@link #writeRaw} because that does not properly handle
17741774
* value separators needed in Array or Object contexts.
17751775
*<p>
@@ -1982,7 +1982,7 @@ public WritableTypeId writeTypePrefix(WritableTypeId typeIdDef) throws IOExcepti
19821982
typeIdDef.wrapperWritten = true;
19831983

19841984
Inclusion incl = typeIdDef.include;
1985-
// first: can not output "as property" if value not Object; if so, must do "as array"
1985+
// first: cannot output "as property" if value not Object; if so, must do "as array"
19861986
if ((valueShape != JsonToken.START_OBJECT)
19871987
&& incl.requiresObjectContext()) {
19881988
typeIdDef.include = incl = WritableTypeId.Inclusion.WRAPPER_ARRAY;

src/main/java/com/fasterxml/jackson/core/JsonParser.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public enum Feature {
366366
* Most common reason for disabling this feature is to avoid leaking information about
367367
* internal information; this may be done for security reasons.
368368
* Note that even if source reference is included, only parts of contents are usually
369-
* printed, and not the whole contents. Further, many source reference types can not
369+
* printed, and not the whole contents. Further, many source reference types cannot
370370
* necessarily access contents (like streams), so only type is indicated, not contents.
371371
*<p>
372372
* Since 2.16 feature is <b>disabled</b> by default (before 2.16 it was enabled),
@@ -888,12 +888,12 @@ public void setCurrentValue(Object v) {
888888
* done after reading all content of interest using parser.
889889
* Content is released by writing it to given stream if possible;
890890
* if underlying input is byte-based it can released, if not (char-based)
891-
* it can not.
891+
* it cannot.
892892
*
893893
* @param out OutputStream to which buffered, undecoded content is written to
894894
*
895895
* @return -1 if the underlying content source is not byte based
896-
* (that is, input can not be sent to {@link OutputStream};
896+
* (that is, input cannot be sent to {@link OutputStream};
897897
* otherwise number of bytes released (0 if there was nothing to release)
898898
*
899899
* @throws IOException if write to stream threw exception
@@ -909,12 +909,12 @@ public int releaseBuffered(OutputStream out) throws IOException {
909909
* done after reading all content of interest using parser.
910910
* Content is released by writing it to given writer if possible;
911911
* if underlying input is char-based it can released, if not (byte-based)
912-
* it can not.
912+
* it cannot.
913913
*
914914
* @param w Writer to which buffered but unprocessed content is written to
915915
*
916916
* @return -1 if the underlying content source is not char-based
917-
* (that is, input can not be sent to {@link Writer};
917+
* (that is, input cannot be sent to {@link Writer};
918918
* otherwise number of chars released (0 if there was nothing to release)
919919
*
920920
* @throws IOException if write using Writer threw exception
@@ -1926,7 +1926,7 @@ public short getShortValue() throws IOException
19261926
/**
19271927
* Numeric accessor that can be called when the current
19281928
* token is of type {@link JsonToken#VALUE_NUMBER_INT} and
1929-
* it can not be used as a Java long primitive type due to its
1929+
* it cannot be used as a Java long primitive type due to its
19301930
* magnitude.
19311931
* It can also be called for {@link JsonToken#VALUE_NUMBER_FLOAT};
19321932
* if so, it is equivalent to calling {@link #getDecimalValue}
@@ -2146,7 +2146,7 @@ public int readBinaryValue(Base64Variant bv, OutputStream out) throws IOExceptio
21462146
* and 1 (true), and Strings are parsed using default Java language integer
21472147
* parsing rules.
21482148
*<p>
2149-
* If representation can not be converted to an int (including structured type
2149+
* If representation cannot be converted to an int (including structured type
21502150
* markers like start/end Object/Array)
21512151
* default value of <b>0</b> will be returned; no exceptions are thrown.
21522152
*
@@ -2167,7 +2167,7 @@ public int getValueAsInt() throws IOException {
21672167
* and 1 (true), and Strings are parsed using default Java language integer
21682168
* parsing rules.
21692169
*<p>
2170-
* If representation can not be converted to an int (including structured type
2170+
* If representation cannot be converted to an int (including structured type
21712171
* markers like start/end Object/Array)
21722172
* specified <b>def</b> will be returned; no exceptions are thrown.
21732173
*
@@ -2187,7 +2187,7 @@ public int getValueAsInt() throws IOException {
21872187
* and 1 (true), and Strings are parsed using default Java language integer
21882188
* parsing rules.
21892189
*<p>
2190-
* If representation can not be converted to a long (including structured type
2190+
* If representation cannot be converted to a long (including structured type
21912191
* markers like start/end Object/Array)
21922192
* default value of <b>0L</b> will be returned; no exceptions are thrown.
21932193
*
@@ -2208,7 +2208,7 @@ public long getValueAsLong() throws IOException {
22082208
* and 1 (true), and Strings are parsed using default Java language integer
22092209
* parsing rules.
22102210
*<p>
2211-
* If representation can not be converted to a long (including structured type
2211+
* If representation cannot be converted to a long (including structured type
22122212
* markers like start/end Object/Array)
22132213
* specified <b>def</b> will be returned; no exceptions are thrown.
22142214
*
@@ -2230,7 +2230,7 @@ public long getValueAsLong(long def) throws IOException {
22302230
* and 1.0 (true), and Strings are parsed using default Java language floating
22312231
* point parsing rules.
22322232
*<p>
2233-
* If representation can not be converted to a double (including structured types
2233+
* If representation cannot be converted to a double (including structured types
22342234
* like Objects and Arrays),
22352235
* default value of <b>0.0</b> will be returned; no exceptions are thrown.
22362236
*
@@ -2251,7 +2251,7 @@ public double getValueAsDouble() throws IOException {
22512251
* and 1.0 (true), and Strings are parsed using default Java language floating
22522252
* point parsing rules.
22532253
*<p>
2254-
* If representation can not be converted to a double (including structured types
2254+
* If representation cannot be converted to a double (including structured types
22552255
* like Objects and Arrays),
22562256
* specified <b>def</b> will be returned; no exceptions are thrown.
22572257
*
@@ -2273,7 +2273,7 @@ public double getValueAsDouble(double def) throws IOException {
22732273
* 0 maps to false
22742274
* and Strings 'true' and 'false' map to corresponding values.
22752275
*<p>
2276-
* If representation can not be converted to a boolean value (including structured types
2276+
* If representation cannot be converted to a boolean value (including structured types
22772277
* like Objects and Arrays),
22782278
* default value of <b>false</b> will be returned; no exceptions are thrown.
22792279
*
@@ -2294,7 +2294,7 @@ public boolean getValueAsBoolean() throws IOException {
22942294
* 0 maps to false
22952295
* and Strings 'true' and 'false' map to corresponding values.
22962296
*<p>
2297-
* If representation can not be converted to a boolean value (including structured types
2297+
* If representation cannot be converted to a boolean value (including structured types
22982298
* like Objects and Arrays),
22992299
* specified <b>def</b> will be returned; no exceptions are thrown.
23002300
*
@@ -2314,7 +2314,7 @@ public boolean getValueAsBoolean(boolean def) throws IOException {
23142314
* {@link java.lang.String}.
23152315
* JSON Strings map naturally; scalar values get converted to
23162316
* their textual representation.
2317-
* If representation can not be converted to a String value (including structured types
2317+
* If representation cannot be converted to a String value (including structured types
23182318
* like Objects and Arrays and {@code null} token), default value of
23192319
* <b>null</b> will be returned; no exceptions are thrown.
23202320
*
@@ -2334,7 +2334,7 @@ public String getValueAsString() throws IOException {
23342334
* {@link java.lang.String}.
23352335
* JSON Strings map naturally; scalar values get converted to
23362336
* their textual representation.
2337-
* If representation can not be converted to a String value (including structured types
2337+
* If representation cannot be converted to a String value (including structured types
23382338
* like Objects and Arrays and {@code null} token), specified default value
23392339
* will be returned; no exceptions are thrown.
23402340
*
@@ -2363,7 +2363,7 @@ public String getValueAsString() throws IOException {
23632363
* Default implementation returns true; overridden by data formats
23642364
* that do support native Object Ids. Caller is expected to either
23652365
* use a non-native notation (explicit property or such), or fail,
2366-
* in case it can not use native object ids.
2366+
* in case it cannot use native object ids.
23672367
*
23682368
* @return {@code True} if the format being read supports native Object Ids;
23692369
* {@code false} if not
@@ -2380,7 +2380,7 @@ public String getValueAsString() throws IOException {
23802380
* Default implementation returns true; overridden by data formats
23812381
* that do support native Type Ids. Caller is expected to either
23822382
* use a non-native notation (explicit property or such), or fail,
2383-
* in case it can not use native type ids.
2383+
* in case it cannot use native type ids.
23842384
*
23852385
* @return {@code True} if the format being read supports native Type Ids;
23862386
* {@code false} if not
@@ -2454,7 +2454,7 @@ public String getValueAsString() throws IOException {
24542454
* Note: this method should NOT be used if the result type is a
24552455
* container ({@link java.util.Collection} or {@link java.util.Map}.
24562456
* The reason is that due to type erasure, key and value types
2457-
* can not be introspected when using this method.
2457+
* cannot be introspected when using this method.
24582458
*
24592459
* @param <T> Nominal type parameter for value type
24602460
*

src/main/java/com/fasterxml/jackson/core/JsonToken.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public enum JsonToken
2121

2222
/**
2323
* NOT_AVAILABLE can be returned if {@link JsonParser}
24-
* implementation can not currently return the requested
24+
* implementation cannot currently return the requested
2525
* token (usually next one), or even if any will be
2626
* available, but that may be able to determine this in
2727
* future. This is the case with non-blocking parsers --
28-
* they can not block to wait for more data to parse and
28+
* they cannot block to wait for more data to parse and
2929
* must return something.
3030
*/
3131
NOT_AVAILABLE(null, JsonTokenId.ID_NOT_AVAILABLE),

src/main/java/com/fasterxml/jackson/core/ObjectCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected ObjectCodec() { }
4444
* Note: this method should NOT be used if the result type is a
4545
* container ({@link java.util.Collection} or {@link java.util.Map}.
4646
* The reason is that due to type erasure, key and value types
47-
* can not be introspected when using this method.
47+
* cannot be introspected when using this method.
4848
*
4949
* @param <T> Nominal parameter for target type
5050
*

src/main/java/com/fasterxml/jackson/core/StreamReadFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public enum StreamReadFeature
8282
* Most common reason for disabling this feature is to avoid leaking
8383
* internal information; this may be done for security reasons.
8484
* Note that even if source reference is included, only parts of contents are usually
85-
* printed, and not the whole contents. Further, many source reference types can not
85+
* printed, and not the whole contents. Further, many source reference types cannot
8686
* necessarily access contents (like streams), so only type is indicated, not contents.
8787
*<p>
8888
* Feature is enabled by default, meaning that "source reference" information is passed

src/main/java/com/fasterxml/jackson/core/TSFBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ public B configure(StreamWriteFeature f, boolean state) {
261261
/* 26-Jun-2018, tatu: This should not be needed here, but due to 2.x limitations,
262262
* we do need to include it or require casting.
263263
* Specifically: since `JsonFactory` (and not `TokenStreamFactory`) is base class
264-
* for all backends, it can not expose JSON-specific builder, but this.
264+
* for all backends, it cannot expose JSON-specific builder, but this.
265265
* So let's select lesser evil(s).
266266
*/
267267

src/main/java/com/fasterxml/jackson/core/TokenStreamFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ protected OutputStream _createDataOutputWrapper(DataOutput out) {
282282
*/
283283
protected InputStream _optimizedStreamFromURL(URL url) throws IOException {
284284
if ("file".equals(url.getProtocol())) {
285-
/* Can not do this if the path refers
285+
/* Cannot do this if the path refers
286286
* to a network drive on windows. This fixes the problem;
287287
* might not be needed on all platforms (NFS?), but should not
288288
* matter a lot: performance penalty of extra wrapping is more

src/main/java/com/fasterxml/jackson/core/format/InputAccessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public boolean hasMoreBytes() throws IOException
103103
return false;
104104
}
105105
int amount = _buffer.length - _ptr;
106-
if (amount < 1) { // can not load any more
106+
if (amount < 1) { // cannot load any more
107107
return false;
108108
}
109109
int count = _in.read(_buffer, _ptr, amount);

src/main/java/com/fasterxml/jackson/core/format/MatchStrength.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
public enum MatchStrength
1111
{
1212
/**
13-
* Value that indicates that given data can not be in given format.
13+
* Value that indicates that given data cannot be in given format.
1414
*/
1515
NO_MATCH,
1616

1717
/**
18-
* Value that indicates that detector can not find out whether could
18+
* Value that indicates that detector cannot find out whether could
1919
* be a match or not.
2020
* This can occur for example for textual data formats t
21-
* when there are so many leading spaces that detector can not
21+
* when there are so many leading spaces that detector cannot
2222
* find the first data byte (because detectors typically limit lookahead
2323
* to some smallish value).
2424
*/
2525
INCONCLUSIVE,
2626

2727
/**
2828
* Value that indicates that given data could be of specified format (i.e.
29-
* it can not be ruled out). This can occur for example when seen data
29+
* it cannot be ruled out). This can occur for example when seen data
3030
* is both not in canonical formats (for example: JSON data should be a JSON Array or Object
3131
* not a scalar value, as per JSON specification) and there are known use case
3232
* where a format detected is actually used (plain JSON Strings are actually used, even

src/main/java/com/fasterxml/jackson/core/io/IOContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public class IOContext implements AutoCloseable
124124
/**
125125
* Reference temporary buffer Parser instances need if calling
126126
* app decides it wants to access name via 'getTextCharacters' method.
127-
* Regular text buffer can not be used as it may contain textual
127+
* Regular text buffer cannot be used as it may contain textual
128128
* representation of the value token.
129129
*/
130130
protected char[] _nameCopyBuffer;

src/main/java/com/fasterxml/jackson/core/json/ByteSourceJsonBootstrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ private boolean checkUTF32(int quad) throws IOException
494494
} else if ((quad & ~0x0000FF00) == 0) { // 0x0000??00 -> UTF32-in-order
495495
reportWeirdUCS4("2143");
496496
} else {
497-
// Can not be valid UTF-32 encoded JSON...
497+
// Cannot be valid UTF-32 encoded JSON...
498498
return false;
499499
}
500500
// Not BOM (just regular content), nothing to skip past:

0 commit comments

Comments
 (0)