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 "iff" typo in Javadoc and comments, remove some redundant expressions #1278

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/com/fasterxml/jackson/core/Base64Variant.java
Expand Up @@ -725,7 +725,7 @@ public void decode(String str, ByteArrayBuilder builder) throws IllegalArgumentE
decodedData = (decodedData << 6) | bits;
// third base64 char; can be padding, but not ws
if (ptr >= len) {
// but as per [JACKSON-631] can be end-of-input, iff padding is not required
// but as per [JACKSON-631] can be end-of-input, if padding is not required
if (!requiresPaddingOnRead()) {
decodedData >>= 4;
builder.append(decodedData);
Expand Down Expand Up @@ -761,7 +761,7 @@ public void decode(String str, ByteArrayBuilder builder) throws IllegalArgumentE
decodedData = (decodedData << 6) | bits;
// fourth and last base64 char; can be padding, but not ws
if (ptr >= len) {
// but as per [JACKSON-631] can be end-of-input, iff padding on read is not required
// but as per [JACKSON-631] can be end-of-input, if padding on read is not required
if (!requiresPaddingOnRead()) {
decodedData >>= 2;
builder.appendTwoBytes(decodedData);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fasterxml/jackson/core/JsonParser.java
Expand Up @@ -1194,7 +1194,7 @@ public Boolean nextBooleanValue() throws IOException {
/**
* Method that will skip all child tokens of an array or
* object token that the parser currently points to,
* iff stream points to
* if stream points to
* {@link JsonToken#START_OBJECT} or {@link JsonToken#START_ARRAY}.
* If not, it will do nothing.
* After skipping, stream will point to <b>matching</b>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fasterxml/jackson/core/TreeNode.java
Expand Up @@ -228,7 +228,7 @@ public interface TreeNode
TreeNode path(int index);

/**
* Method for accessing names of all fields for this node, iff
* Method for accessing names of all fields for this node, if
* this node is an Object node. Number of field names accessible
* will be {@link #size}.
*
Expand Down
Expand Up @@ -502,7 +502,7 @@ protected void _releaseBuffers() throws IOException {

/**
* Method called when an EOF is encountered between tokens.
* If so, it may be a legitimate EOF, but only iff there
* If so, it may be a legitimate EOF, but only if there
* is no open non-root context.
*/
@Override
Expand Down
Expand Up @@ -945,7 +945,7 @@ public void writeTypeId(Object id) throws IOException {
/**********************************************************
*/

// Base class definitions for these seems correct to me, iff not directly delegating:
// Base class definitions for these seems correct to me, if not directly delegating:

/*
@Override
Expand Down Expand Up @@ -990,7 +990,7 @@ public void writeTree(TreeNode rootNode) throws IOException {
/**********************************************************
*/

// Base class definitions for these seems correct to me, iff not directly delegating:
// Base class definitions for these seems correct to me, if not directly delegating:

/*
@Override
Expand Down
Expand Up @@ -253,11 +253,11 @@ private String toDecimalString(double v) {

/*
Returns
PLUS_ZERO iff v is 0.0
MINUS_ZERO iff v is -0.0
PLUS_INF iff v is POSITIVE_INFINITY
MINUS_INF iff v is NEGATIVE_INFINITY
NAN iff v is NaN
PLUS_ZERO if v is 0.0
MINUS_ZERO if v is -0.0
PLUS_INF if v is POSITIVE_INFINITY
MINUS_INF if v is NEGATIVE_INFINITY
NAN if v is NaN
*/
private int toDecimal(double v) {
/*
Expand Down Expand Up @@ -360,8 +360,8 @@ private int toDecimal(int q, long c, int dk) {

sp10 = 10 s'
tp10 = 10 t'
upin iff u' = sp10 10^k in Rv
wpin iff w' = tp10 10^k in Rv
upin if u' = sp10 10^k in Rv
wpin if w' = tp10 10^k in Rv
See section 9.4 of [1].
*/
long sp10 = 10 * multiplyHigh(s, 115_292_150_460_684_698L << 4);
Expand All @@ -375,8 +375,8 @@ private int toDecimal(int q, long c, int dk) {

/*
10 <= s < 100 or s >= 100 and u', w' not in Rv
uin iff u = s 10^k in Rv
win iff w = t 10^k in Rv
uin if u = s 10^k in Rv
win if w = t 10^k in Rv
See section 9.4 of [1].
*/
long t = s + 1;
Expand Down
Expand Up @@ -252,11 +252,11 @@ private String toDecimalString(float v) {

/*
Returns
PLUS_ZERO iff v is 0.0
MINUS_ZERO iff v is -0.0
PLUS_INF iff v is POSITIVE_INFINITY
MINUS_INF iff v is NEGATIVE_INFINITY
NAN iff v is NaN
PLUS_ZERO if v is 0.0
MINUS_ZERO if v is -0.0
PLUS_INF if v is POSITIVE_INFINITY
MINUS_INF if v is NEGATIVE_INFINITY
NAN if v is NaN
*/
private int toDecimal(float v) {
/*
Expand Down Expand Up @@ -358,8 +358,8 @@ private int toDecimal(int q, int c, int dk) {

sp10 = 10 s'
tp10 = 10 t'
upin iff u' = sp10 10^k in Rv
wpin iff w' = tp10 10^k in Rv
upin if u' = sp10 10^k in Rv
wpin if w' = tp10 10^k in Rv
See section 9.4 of [1].
*/
int sp10 = 10 * (int) (s * 1_717_986_919L >>> 34);
Expand All @@ -373,8 +373,8 @@ private int toDecimal(int q, int c, int dk) {

/*
10 <= s < 100 or s >= 100 and u', w' not in Rv
uin iff u = s 10^k in Rv
win iff w = t 10^k in Rv
uin if u = s 10^k in Rv
win if w = t 10^k in Rv
See section 9.4 of [1].
*/
int t = s + 1;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fasterxml/jackson/core/package-info.java
Expand Up @@ -14,7 +14,7 @@
*<li>{@link com.fasterxml.jackson.core.TreeNode} is included
*within Streaming API to support integration of the Tree Model
*(which is based on <code>JsonNode</code>) with the basic
*parsers and generators (iff using mapping-supporting factory: which
*parsers and generators (if using mapping-supporting factory: which
*is part of Mapping API, not core)
* </li>
*<li>{@link com.fasterxml.jackson.core.ObjectCodec} is included so that
Expand Down
Expand Up @@ -273,7 +273,7 @@ void testFlog10threeQuartersPow2() {

The first equation above is equivalent to
10^k <= 2^e < 10^(k+1)
Equality holds iff e = k = 0.
Equality holds if e = k = 0.
Henceforth, the predicates to check are equivalent to
k = 0, if e = 0
10^k < 2^e < 10^(k+1), otherwise
Expand Down Expand Up @@ -338,7 +338,7 @@ void testFlog10pow2() {
the right inequality shows that k >= 0.
The left inequality means the same as
len2(10^k) <= e
and the right inequality holds iff
and the right inequality holds if
e < len2(10^(k+1))
The original predicate is thus equivalent to
len2(10^k) <= e < len2(10^(k+1))
Expand Down Expand Up @@ -377,7 +377,7 @@ e < len2(10^(k+1))

The first equation above is equivalent to
2^k <= 10^e < 2^(k+1)
Equality holds iff e = 0, implying k = 0.
Equality holds if e = 0, implying k = 0.
Henceforth, the equivalent predicates to check are
k = 0, if e = 0
2^k < 10^e < 2^(k+1), otherwise
Expand Down