From 6d43e1746971578e2db2c0f460c85e93231e4e9c Mon Sep 17 00:00:00 2001 From: Philzen Date: Fri, 26 Apr 2024 23:10:11 +0200 Subject: [PATCH] Fix typo in code comments ("iff") --- .../fasterxml/jackson/core/Base64Variant.java | 4 ++-- .../filter/FilteringGeneratorDelegate.java | 4 ++-- .../core/io/schubfach/DoubleToDecimal.java | 18 +++++++++--------- .../core/io/schubfach/FloatToDecimal.java | 18 +++++++++--------- .../core/io/schubfach/MathUtilsTest.java | 6 +++--- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/core/Base64Variant.java b/src/main/java/com/fasterxml/jackson/core/Base64Variant.java index e8f3539ae8..e5fbc8b7ca 100644 --- a/src/main/java/com/fasterxml/jackson/core/Base64Variant.java +++ b/src/main/java/com/fasterxml/jackson/core/Base64Variant.java @@ -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); @@ -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); diff --git a/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java b/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java index 4b49596e63..b62b36bca0 100644 --- a/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java +++ b/src/main/java/com/fasterxml/jackson/core/filter/FilteringGeneratorDelegate.java @@ -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 @@ -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 diff --git a/src/main/java/com/fasterxml/jackson/core/io/schubfach/DoubleToDecimal.java b/src/main/java/com/fasterxml/jackson/core/io/schubfach/DoubleToDecimal.java index b7ffb73eb1..35cdec5428 100644 --- a/src/main/java/com/fasterxml/jackson/core/io/schubfach/DoubleToDecimal.java +++ b/src/main/java/com/fasterxml/jackson/core/io/schubfach/DoubleToDecimal.java @@ -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) { /* @@ -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); @@ -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; diff --git a/src/main/java/com/fasterxml/jackson/core/io/schubfach/FloatToDecimal.java b/src/main/java/com/fasterxml/jackson/core/io/schubfach/FloatToDecimal.java index ba71387a72..6f51b3930a 100644 --- a/src/main/java/com/fasterxml/jackson/core/io/schubfach/FloatToDecimal.java +++ b/src/main/java/com/fasterxml/jackson/core/io/schubfach/FloatToDecimal.java @@ -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) { /* @@ -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); @@ -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; diff --git a/src/test/java/com/fasterxml/jackson/core/io/schubfach/MathUtilsTest.java b/src/test/java/com/fasterxml/jackson/core/io/schubfach/MathUtilsTest.java index 95de7c8fc7..52cbbeff3c 100644 --- a/src/test/java/com/fasterxml/jackson/core/io/schubfach/MathUtilsTest.java +++ b/src/test/java/com/fasterxml/jackson/core/io/schubfach/MathUtilsTest.java @@ -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 @@ -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)) @@ -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