You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2019/11/28 10:50:35 UTC
[commons-codec] branch master updated (1b98897 -> ff3f026)
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git.
from 1b98897 Explicit test for hash128x64 with negative seed.
new 7b19615 [CODEC-270] Add more impossible base32/64 test cases.
new 52396f8 [CODEC-270] Fix masked check of the final bits to discard.
new 73c8b5e [CODEC-270]: Updated changes.xml
new 242d3fe Remove javadoc references to non-visible fields.
new ff3f026 Fix javadoc errors in test classes.
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/changes/changes.xml | 1 +
.../org/apache/commons/codec/binary/Base32.java | 45 ++++++++----
.../org/apache/commons/codec/binary/Base64.java | 28 +++++---
.../apache/commons/codec/binary/BaseNCodec.java | 6 +-
.../commons/codec/language/DoubleMetaphone.java | 2 +-
.../apache/commons/codec/language/Metaphone.java | 2 +-
.../org/apache/commons/codec/language/Soundex.java | 9 +--
.../java/org/apache/commons/codec/net/QCodec.java | 2 +-
.../codec/binary/Base32InputStreamTest.java | 9 +++
.../apache/commons/codec/binary/Base32Test.java | 82 +++++++++++++++++++++-
.../codec/binary/Base64InputStreamTest.java | 9 +++
.../apache/commons/codec/binary/Base64Test.java | 62 ++++++++++++++++
.../commons/codec/language/Caverphone1Test.java | 8 +--
.../commons/codec/language/Caverphone2Test.java | 18 ++---
.../codec/language/ColognePhoneticTest.java | 3 +-
.../codec/language/DaitchMokotoffSoundexTest.java | 3 +-
.../apache/commons/codec/language/NysiisTest.java | 30 +++-----
.../apache/commons/codec/language/SoundexTest.java | 9 +--
.../codec/language/bm/BeiderMorseEncoderTest.java | 10 ++-
.../org/apache/commons/codec/net/BCodecTest.java | 10 +--
20 files changed, 254 insertions(+), 94 deletions(-)
[commons-codec] 02/05: [CODEC-270] Fix masked check of the final
bits to discard.
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git
commit 52396f8136b0328b17afd715b1c3f5a1f7e94608
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Nov 24 23:39:27 2019 +0000
[CODEC-270] Fix masked check of the final bits to discard.
The mask must check all the bits to discard are zero.
---
.../org/apache/commons/codec/binary/Base32.java | 45 ++++++++----
.../org/apache/commons/codec/binary/Base64.java | 28 +++++---
.../apache/commons/codec/binary/Base32Test.java | 79 ++++++++++++++++++++++
.../apache/commons/codec/binary/Base64Test.java | 61 +++++++++++++++++
4 files changed, 188 insertions(+), 25 deletions(-)
diff --git a/src/main/java/org/apache/commons/codec/binary/Base32.java b/src/main/java/org/apache/commons/codec/binary/Base32.java
index a8ede4e..7298801 100644
--- a/src/main/java/org/apache/commons/codec/binary/Base32.java
+++ b/src/main/java/org/apache/commons/codec/binary/Base32.java
@@ -114,8 +114,20 @@ public class Base32 extends BaseNCodec {
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
};
+ /** Mask used to extract 7 bits, used when decoding final trailing character. */
+ private static final long MASK_7BITS = 0x7fL;
+ /** Mask used to extract 6 bits, used when decoding final trailing character. */
+ private static final long MASK_6BITS = 0x3fL;
/** Mask used to extract 5 bits, used when encoding Base32 bytes */
private static final int MASK_5BITS = 0x1f;
+ /** Mask used to extract 4 bits, used when decoding final trailing character. */
+ private static final long MASK_4BITS = 0x0fL;
+ /** Mask used to extract 3 bits, used when decoding final trailing character. */
+ private static final long MASK_3BITS = 0x07L;
+ /** Mask used to extract 2 bits, used when decoding final trailing character. */
+ private static final long MASK_2BITS = 0x03L;
+ /** Mask used to extract 1 bits, used when decoding final trailing character. */
+ private static final long MASK_1BITS = 0x01L;
// The static final fields above are used for the original static byte[] methods on Base32.
// The private member fields below are used with the new streaming approach, which requires
@@ -335,7 +347,8 @@ public class Base32 extends BaseNCodec {
* Amount of bytes available from input for decoding.
* @param context the context to be used
*
- * Output is written to {@link Context#buffer} as 8-bit octets, using {@link Context#pos} as the buffer position
+ * Output is written to {@link org.apache.commons.codec.binary.BaseNCodec.Context#buffer Context#buffer}
+ * as 8-bit octets, using {@link org.apache.commons.codec.binary.BaseNCodec.Context#pos Context#pos} as the buffer position
*/
@Override
void decode(final byte[] in, int inPos, final int inAvail, final Context context) {
@@ -381,35 +394,35 @@ public class Base32 extends BaseNCodec {
// we ignore partial bytes, i.e. only multiples of 8 count
switch (context.modulus) {
case 2 : // 10 bits, drop 2 and output one byte
- validateCharacter(2, context);
+ validateCharacter(MASK_2BITS, context);
buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 2) & MASK_8BITS);
break;
case 3 : // 15 bits, drop 7 and output 1 byte
- validateCharacter(7, context);
+ validateCharacter(MASK_7BITS, context);
buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 7) & MASK_8BITS);
break;
case 4 : // 20 bits = 2*8 + 4
- validateCharacter(4, context);
+ validateCharacter(MASK_4BITS, context);
context.lbitWorkArea = context.lbitWorkArea >> 4; // drop 4 bits
buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 8) & MASK_8BITS);
buffer[context.pos++] = (byte) ((context.lbitWorkArea) & MASK_8BITS);
break;
case 5 : // 25bits = 3*8 + 1
- validateCharacter(1, context);
+ validateCharacter(MASK_1BITS, context);
context.lbitWorkArea = context.lbitWorkArea >> 1;
buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 16) & MASK_8BITS);
buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 8) & MASK_8BITS);
buffer[context.pos++] = (byte) ((context.lbitWorkArea) & MASK_8BITS);
break;
case 6 : // 30bits = 3*8 + 6
- validateCharacter(6, context);
+ validateCharacter(MASK_6BITS, context);
context.lbitWorkArea = context.lbitWorkArea >> 6;
buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 16) & MASK_8BITS);
buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 8) & MASK_8BITS);
buffer[context.pos++] = (byte) ((context.lbitWorkArea) & MASK_8BITS);
break;
case 7 : // 35 = 4*8 +3
- validateCharacter(3, context);
+ validateCharacter(MASK_3BITS, context);
context.lbitWorkArea = context.lbitWorkArea >> 3;
buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 24) & MASK_8BITS);
buffer[context.pos++] = (byte) ((context.lbitWorkArea >> 16) & MASK_8BITS);
@@ -548,19 +561,23 @@ public class Base32 extends BaseNCodec {
}
/**
- * <p>
- * Validates whether the character is possible in the context of the set of possible base 32 values.
- * </p>
+ * Validates whether decoding the final trailing character is possible in the context
+ * of the set of possible base 32 values.
+ *
+ * <p>The character is valid if the lower bits within the provided mask are zero. This
+ * is used to test the final trailing base-32 digit is zero in the bits that will be discarded.
*
- * @param numBits number of least significant bits to check
+ * @param emptyBitsMask The mask of the lower bits that should be empty
* @param context the context to be used
*
* @throws IllegalArgumentException if the bits being checked contain any non-zero value
*/
- private void validateCharacter(final int numBits, final Context context) {
- if ((context.lbitWorkArea & numBits) != 0) {
+ private static void validateCharacter(final long emptyBitsMask, final Context context) {
+ // Use the long bit work area
+ if ((context.lbitWorkArea & emptyBitsMask) != 0) {
throw new IllegalArgumentException(
- "Last encoded character (before the paddings if any) is a valid base 32 alphabet but not a possible value");
+ "Last encoded character (before the paddings if any) is a valid base 32 alphabet but not a possible value. " +
+ "Expected the discarded bits to be zero.");
}
}
}
diff --git a/src/main/java/org/apache/commons/codec/binary/Base64.java b/src/main/java/org/apache/commons/codec/binary/Base64.java
index aed7843..415f6fb 100644
--- a/src/main/java/org/apache/commons/codec/binary/Base64.java
+++ b/src/main/java/org/apache/commons/codec/binary/Base64.java
@@ -128,6 +128,10 @@ public class Base64 extends BaseNCodec {
*/
/** Mask used to extract 6 bits, used when encoding */
private static final int MASK_6BITS = 0x3f;
+ /** Mask used to extract 4 bits, used when decoding final trailing character. */
+ private static final int MASK_4BITS = 0xf;
+ /** Mask used to extract 2 bits, used when decoding final trailing character. */
+ private static final int MASK_2BITS = 0x3;
// The static final fields above are used for the original static byte[] methods on Base64.
// The private member fields below are used with the new streaming approach, which requires
@@ -469,12 +473,12 @@ public class Base64 extends BaseNCodec {
// TODO not currently tested; perhaps it is impossible?
break;
case 2 : // 12 bits = 8 + 4
- validateCharacter(4, context);
+ validateCharacter(MASK_4BITS, context);
context.ibitWorkArea = context.ibitWorkArea >> 4; // dump the extra 4 bits
buffer[context.pos++] = (byte) ((context.ibitWorkArea) & MASK_8BITS);
break;
case 3 : // 18 bits = 8 + 8 + 2
- validateCharacter(2, context);
+ validateCharacter(MASK_2BITS, context);
context.ibitWorkArea = context.ibitWorkArea >> 2; // dump 2 bits
buffer[context.pos++] = (byte) ((context.ibitWorkArea >> 8) & MASK_8BITS);
buffer[context.pos++] = (byte) ((context.ibitWorkArea) & MASK_8BITS);
@@ -784,20 +788,22 @@ public class Base64 extends BaseNCodec {
}
/**
- * <p>
- * Validates whether the character is possible in the context of the set of possible base 64 values.
- * </p>
+ * Validates whether decoding the final trailing character is possible in the context
+ * of the set of possible base 64 values.
+ *
+ * <p>The character is valid if the lower bits within the provided mask are zero. This
+ * is used to test the final trailing base-64 digit is zero in the bits that will be discarded.
*
- * @param numBitsToDrop number of least significant bits to check
+ * @param emptyBitsMask The mask of the lower bits that should be empty
* @param context the context to be used
*
* @throws IllegalArgumentException if the bits being checked contain any non-zero value
*/
- private long validateCharacter(final int numBitsToDrop, final Context context) {
- if ((context.ibitWorkArea & numBitsToDrop) != 0) {
- throw new IllegalArgumentException(
- "Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value");
+ private static void validateCharacter(final int emptyBitsMask, final Context context) {
+ if ((context.ibitWorkArea & emptyBitsMask) != 0) {
+ throw new IllegalArgumentException(
+ "Last encoded character (before the paddings if any) is a valid base 64 alphabet but not a possible value. " +
+ "Expected the discarded bits to be zero.");
}
- return context.ibitWorkArea >> numBitsToDrop;
}
}
diff --git a/src/test/java/org/apache/commons/codec/binary/Base32Test.java b/src/test/java/org/apache/commons/codec/binary/Base32Test.java
index 725b912..de62be8 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base32Test.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base32Test.java
@@ -71,6 +71,16 @@ public class Base32Test {
"CPNMUOJ1E2======"
};
+ /**
+ * Copy of the standard base-32 encoding table. Used to test decoding the final
+ * character of encoded bytes.
+ */
+ private static final byte[] ENCODE_TABLE = {
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ '2', '3', '4', '5', '6', '7',
+ };
+
private static final Object[][] BASE32_BINARY_TEST_CASES;
// { null, "O0o0O0o0" }
@@ -298,4 +308,73 @@ public class Base32Test {
}
}
}
+
+ @Test
+ public void testBase32DecodingOfTrailing10Bits() {
+ assertBase32DecodingOfTrailingBits(10);
+ }
+
+ @Test
+ public void testBase32DecodingOfTrailing15Bits() {
+ assertBase32DecodingOfTrailingBits(15);
+ }
+
+ @Test
+ public void testBase32DecodingOfTrailing20Bits() {
+ assertBase32DecodingOfTrailingBits(20);
+ }
+
+ @Test
+ public void testBase32DecodingOfTrailing25Bits() {
+ assertBase32DecodingOfTrailingBits(25);
+ }
+
+ @Test
+ public void testBase32DecodingOfTrailing30Bits() {
+ assertBase32DecodingOfTrailingBits(30);
+ }
+
+ @Test
+ public void testBase32DecodingOfTrailing35Bits() {
+ assertBase32DecodingOfTrailingBits(35);
+ }
+
+ /**
+ * Test base 32 decoding of the final trailing bits. Trailing encoded bytes
+ * cannot fit exactly into 5-bit characters so the last character has a limited
+ * alphabet where the final bits are zero. This asserts that illegal final
+ * characters throw an exception when decoding.
+ *
+ * @param nbits the number of trailing bits (must be a factor of 5 and {@code <40})
+ */
+ private static void assertBase32DecodingOfTrailingBits(int nbits) {
+ final Base32 codec = new Base32();
+ // Create the encoded bytes. The first characters must be valid so fill with 'zero'.
+ final byte[] encoded = new byte[nbits / 5];
+ Arrays.fill(encoded, ENCODE_TABLE[0]);
+ // Compute how many bits would be discarded from 8-bit bytes
+ final int discard = nbits % 8;
+ final int emptyBitsMask = (1 << discard) - 1;
+ // Enumerate all 32 possible final characters in the last position
+ final int last = encoded.length - 1;
+ for (int i = 0; i < 32; i++) {
+ encoded[last] = ENCODE_TABLE[i];
+ // If the lower bits are set we expect an exception. This is not a valid
+ // final character.
+ if ((i & emptyBitsMask) != 0) {
+ try {
+ codec.decode(encoded);
+ fail("Final base-32 digit should not be allowed");
+ } catch (final IllegalArgumentException ex) {
+ // expected
+ }
+ } else {
+ // Otherwise this should decode
+ final byte[] decoded = codec.decode(encoded);
+ // Compute the bits that were encoded. This should match the final decoded byte.
+ final int bitsEncoded = i >> discard;
+ assertEquals("Invalid decoding of last character", bitsEncoded, decoded[decoded.length - 1]);
+ }
+ }
+ }
}
diff --git a/src/test/java/org/apache/commons/codec/binary/Base64Test.java b/src/test/java/org/apache/commons/codec/binary/Base64Test.java
index 442fc4c..cf73709 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base64Test.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base64Test.java
@@ -52,6 +52,18 @@ public class Base64Test {
"AB",
};
+ /**
+ * Copy of the standard base-64 encoding table. Used to test decoding the final
+ * character of encoded bytes.
+ */
+ private static final byte[] STANDARD_ENCODE_TABLE = {
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
+ 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
+ };
+
private final Random random = new Random();
/**
@@ -1317,4 +1329,53 @@ public class Base64Test {
}
}
}
+
+ @Test
+ public void testBase64DecodingOfTrailing12Bits() {
+ assertBase64DecodingOfTrailingBits(12);
+ }
+
+ @Test
+ public void testBase64DecodingOfTrailing18Bits() {
+ assertBase64DecodingOfTrailingBits(18);
+ }
+
+ /**
+ * Test base 64 decoding of the final trailing bits. Trailing encoded bytes
+ * cannot fit exactly into 6-bit characters so the last character has a limited
+ * alphabet where the final bits are zero. This asserts that illegal final
+ * characters throw an exception when decoding.
+ *
+ * @param nbits the number of trailing bits (must be a factor of 6 and {@code <24})
+ */
+ private static void assertBase64DecodingOfTrailingBits(int nbits) {
+ final Base64 codec = new Base64();
+ // Create the encoded bytes. The first characters must be valid so fill with 'zero'.
+ final byte[] encoded = new byte[nbits / 6];
+ Arrays.fill(encoded, STANDARD_ENCODE_TABLE[0]);
+ // Compute how many bits would be discarded from 8-bit bytes
+ final int discard = nbits % 8;
+ final int emptyBitsMask = (1 << discard) - 1;
+ // Enumerate all 64 possible final characters in the last position
+ final int last = encoded.length - 1;
+ for (int i = 0; i < 64; i++) {
+ encoded[last] = STANDARD_ENCODE_TABLE[i];
+ // If the lower bits are set we expect an exception. This is not a valid
+ // final character.
+ if ((i & emptyBitsMask) != 0) {
+ try {
+ codec.decode(encoded);
+ fail("Final base-64 digit should not be allowed");
+ } catch (final IllegalArgumentException ex) {
+ // expected
+ }
+ } else {
+ // Otherwise this should decode
+ final byte[] decoded = codec.decode(encoded);
+ // Compute the bits that were encoded. This should match the final decoded byte.
+ final int bitsEncoded = i >> discard;
+ assertEquals("Invalid decoding of last character", bitsEncoded, decoded[decoded.length - 1]);
+ }
+ }
+ }
}
[commons-codec] 01/05: [CODEC-270] Add more impossible base32/64
test cases.
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git
commit 7b1961506509391ec847bb1dc3783a87f8069057
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Sun Nov 24 23:08:14 2019 +0000
[CODEC-270] Add more impossible base32/64 test cases.
These currently are parsed by the code as valid but should not be.
Fixed the BCodec test impossible cases to contain the correct RFC 1522
header.
---
src/test/java/org/apache/commons/codec/binary/Base32Test.java | 3 ++-
src/test/java/org/apache/commons/codec/binary/Base64Test.java | 1 +
src/test/java/org/apache/commons/codec/net/BCodecTest.java | 10 ++++++----
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/test/java/org/apache/commons/codec/binary/Base32Test.java b/src/test/java/org/apache/commons/codec/binary/Base32Test.java
index d7d2d34..725b912 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base32Test.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base32Test.java
@@ -51,7 +51,8 @@ public class Base32Test {
"MZXE====",
"MZXWB===",
"MZXW6YB=",
- "MZXW6YTBOC======"
+ "MZXW6YTBOC======",
+ "AB======"
};
private static final String[] BASE32_IMPOSSIBLE_CASES_CHUNKED = {
diff --git a/src/test/java/org/apache/commons/codec/binary/Base64Test.java b/src/test/java/org/apache/commons/codec/binary/Base64Test.java
index a9b9867..442fc4c 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base64Test.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base64Test.java
@@ -49,6 +49,7 @@ public class Base64Test {
"ZmC=",
"Zm9vYE==",
"Zm9vYmC=",
+ "AB",
};
private final Random random = new Random();
diff --git a/src/test/java/org/apache/commons/codec/net/BCodecTest.java b/src/test/java/org/apache/commons/codec/net/BCodecTest.java
index 5a90629..2e23d5a 100644
--- a/src/test/java/org/apache/commons/codec/net/BCodecTest.java
+++ b/src/test/java/org/apache/commons/codec/net/BCodecTest.java
@@ -34,10 +34,12 @@ import org.junit.Test;
*/
public class BCodecTest {
private static final String[] BASE64_IMPOSSIBLE_CASES = {
- "ZE==",
- "ZmC=",
- "Zm9vYE==",
- "Zm9vYmC=",
+ // Require the RFC 1522 "encoded-word" header
+ "=?ASCII?B?ZE==?=",
+ "=?ASCII?B?ZmC=?=",
+ "=?ASCII?B?Zm9vYE==?=",
+ "=?ASCII?B?Zm9vYmC=?=",
+ "=?ASCII?B?AB==?="
};
static final int SWISS_GERMAN_STUFF_UNICODE[] =
[commons-codec] 03/05: [CODEC-270]: Updated changes.xml
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git
commit 73c8b5e68823d39b40d4aad0db22cf05df15dd32
Author: aherbert <ah...@apache.org>
AuthorDate: Mon Nov 25 16:43:17 2019 +0000
[CODEC-270]: Updated changes.xml
---
src/changes/changes.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 4949fcb..9fef2de 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -43,6 +43,7 @@ The <action> type attribute can be add,update,fix,remove.
<body>
<release version="1.14" date="TBD" description="Feature and fix release.">
+ <action issue="CODEC-270" dev="aherbert" type="fix">Base32/64: Fixed decoding check that all the final trailing bits to discard are zero.</action>
<action issue="CODEC-264" dev="aherbert" due-to="Claude Warren" type="add">Add MurmurHash3.hash128x64 methods to fix sign extension error during seeding in hash128 methods.</action>
<action issue="CODEC-267" dev="aherbert" due-to="Claude Warren" type="add">Add MurmurHash3.hash32x86 methods and IncrementalHash32x86 to fix sign extension error in hash32 methods.</action>
<action issue="CODEC-269" dev="aherbert" type="fix">Allow repeat calls to MurmurHash3.IncrementalHash32.end() to generate the same value.</action>
[commons-codec] 05/05: Fix javadoc errors in test classes.
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git
commit ff3f026094b8211c4ab372f22b669487d0a619b1
Author: aherbert <ah...@apache.org>
AuthorDate: Thu Nov 28 10:49:59 2019 +0000
Fix javadoc errors in test classes.
---
.../codec/binary/Base32InputStreamTest.java | 9 +++++++
.../codec/binary/Base64InputStreamTest.java | 9 +++++++
.../commons/codec/language/Caverphone1Test.java | 8 +++---
.../commons/codec/language/Caverphone2Test.java | 18 +++++--------
.../codec/language/ColognePhoneticTest.java | 3 +--
.../codec/language/DaitchMokotoffSoundexTest.java | 3 +--
.../apache/commons/codec/language/NysiisTest.java | 30 ++++++++--------------
.../apache/commons/codec/language/SoundexTest.java | 9 +++----
.../codec/language/bm/BeiderMorseEncoderTest.java | 10 +++-----
9 files changed, 47 insertions(+), 52 deletions(-)
diff --git a/src/test/java/org/apache/commons/codec/binary/Base32InputStreamTest.java b/src/test/java/org/apache/commons/codec/binary/Base32InputStreamTest.java
index 4c149d5..e033741 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base32InputStreamTest.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base32InputStreamTest.java
@@ -144,6 +144,7 @@ public class Base32InputStreamTest {
* Tests skipping past the end of a stream.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testAvailable() throws Throwable {
@@ -380,6 +381,7 @@ public class Base32InputStreamTest {
* Tests markSupported.
*
* @throws Exception
+ * for some failure scenarios.
*/
@Test
public void testMarkSupported() throws Exception {
@@ -395,6 +397,7 @@ public class Base32InputStreamTest {
* Tests read returning 0
*
* @throws Exception
+ * for some failure scenarios.
*/
@Test
public void testRead0() throws Exception {
@@ -430,6 +433,7 @@ public class Base32InputStreamTest {
* Tests read throwing IndexOutOfBoundsException
*
* @throws Exception
+ * for some failure scenarios.
*/
@Test
public void testReadOutOfBounds() throws Exception {
@@ -472,6 +476,7 @@ public class Base32InputStreamTest {
* Tests skipping as a noop
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testSkipNone() throws Throwable {
@@ -490,6 +495,7 @@ public class Base32InputStreamTest {
* Tests skipping number of characters larger than the internal buffer.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testSkipBig() throws Throwable {
@@ -506,6 +512,7 @@ public class Base32InputStreamTest {
* Tests skipping past the end of a stream.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testSkipPastEnd() throws Throwable {
@@ -523,6 +530,7 @@ public class Base32InputStreamTest {
* Tests skipping to the end of a stream.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testSkipToEnd() throws Throwable {
@@ -540,6 +548,7 @@ public class Base32InputStreamTest {
* Tests if negative arguments to skip are handled correctly.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test(expected=IllegalArgumentException.class)
public void testSkipWrongArgument() throws Throwable {
diff --git a/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java b/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java
index 559ff2b..60dd122 100644
--- a/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java
+++ b/src/test/java/org/apache/commons/codec/binary/Base64InputStreamTest.java
@@ -153,6 +153,7 @@ public class Base64InputStreamTest {
* Tests skipping past the end of a stream.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testAvailable() throws Throwable {
@@ -393,6 +394,7 @@ public class Base64InputStreamTest {
* Tests markSupported.
*
* @throws Exception
+ * for some failure scenarios.
*/
@Test
public void testMarkSupported() throws Exception {
@@ -408,6 +410,7 @@ public class Base64InputStreamTest {
* Tests read returning 0
*
* @throws Exception
+ * for some failure scenarios.
*/
@Test
public void testRead0() throws Exception {
@@ -443,6 +446,7 @@ public class Base64InputStreamTest {
* Tests read throwing IndexOutOfBoundsException
*
* @throws Exception
+ * for some failure scenarios.
*/
@Test
public void testReadOutOfBounds() throws Exception {
@@ -485,6 +489,7 @@ public class Base64InputStreamTest {
* Tests skipping number of characters larger than the internal buffer.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testSkipBig() throws Throwable {
@@ -501,6 +506,7 @@ public class Base64InputStreamTest {
* Tests skipping as a noop
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testSkipNone() throws Throwable {
@@ -519,6 +525,7 @@ public class Base64InputStreamTest {
* Tests skipping past the end of a stream.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testSkipPastEnd() throws Throwable {
@@ -536,6 +543,7 @@ public class Base64InputStreamTest {
* Tests skipping to the end of a stream.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test
public void testSkipToEnd() throws Throwable {
@@ -553,6 +561,7 @@ public class Base64InputStreamTest {
* Tests if negative arguments to skip are handled correctly.
*
* @throws Throwable
+ * for some failure scenarios.
*/
@Test(expected=IllegalArgumentException.class)
public void testSkipWrongArgument() throws Throwable {
diff --git a/src/test/java/org/apache/commons/codec/language/Caverphone1Test.java b/src/test/java/org/apache/commons/codec/language/Caverphone1Test.java
index c876d02..96e5586 100644
--- a/src/test/java/org/apache/commons/codec/language/Caverphone1Test.java
+++ b/src/test/java/org/apache/commons/codec/language/Caverphone1Test.java
@@ -39,7 +39,7 @@ public class Caverphone1Test extends StringEncoderAbstractTest<Caverphone1> {
*
* AT1111 words: add, aid, at, art, eat, earth, head, hit, hot, hold, hard, heart, it, out, old
*
- * @throws EncoderException
+ * @throws EncoderException for some failure scenarios.
*/
@Test
public void testCaverphoneRevisitedCommonCodeAT1111() throws EncoderException {
@@ -70,7 +70,7 @@ public class Caverphone1Test extends StringEncoderAbstractTest<Caverphone1> {
/**
* Tests some examples from version 2.0 http://caversham.otago.ac.nz/files/working/ctp150804.pdf
*
- * @throws EncoderException
+ * @throws EncoderException for some failure scenarios.
*/
@Test
public void testIsCaverphoneEquals() throws EncoderException {
@@ -82,7 +82,7 @@ public class Caverphone1Test extends StringEncoderAbstractTest<Caverphone1> {
/**
* Tests example from http://caversham.otago.ac.nz/files/working/ctp060902.pdf
*
- * @throws EncoderException
+ * @throws EncoderException for some failure scenarios.
*/
@Test
public void testSpecificationV1Examples() throws EncoderException {
@@ -93,7 +93,7 @@ public class Caverphone1Test extends StringEncoderAbstractTest<Caverphone1> {
/**
* Tests examples from http://en.wikipedia.org/wiki/Caverphone
*
- * @throws EncoderException
+ * @throws EncoderException for some failure scenarios.
*/
@Test
public void testWikipediaExamples() throws EncoderException {
diff --git a/src/test/java/org/apache/commons/codec/language/Caverphone2Test.java b/src/test/java/org/apache/commons/codec/language/Caverphone2Test.java
index 22e94b8..2a57c3f 100644
--- a/src/test/java/org/apache/commons/codec/language/Caverphone2Test.java
+++ b/src/test/java/org/apache/commons/codec/language/Caverphone2Test.java
@@ -39,8 +39,7 @@ public class Caverphone2Test extends StringEncoderAbstractTest<Caverphone2> {
*
* AT11111111 words: add, aid, at, art, eat, earth, head, hit, hot, hold, hard, heart, it, out, old
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testCaverphoneRevisitedCommonCodeAT11111111() throws EncoderException {
this.checkEncodingVariations("AT11111111", new String[]{
@@ -64,8 +63,7 @@ public class Caverphone2Test extends StringEncoderAbstractTest<Caverphone2> {
/**
* See http://caversham.otago.ac.nz/files/working/ctp150804.pdf
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testCaverphoneRevisitedExamples() throws EncoderException {
final String[][] data = {{"Stevenson", "STFNSN1111"}, {"Peter", "PTA1111111"}};
@@ -75,8 +73,7 @@ public class Caverphone2Test extends StringEncoderAbstractTest<Caverphone2> {
/**
* See http://caversham.otago.ac.nz/files/working/ctp150804.pdf
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testCaverphoneRevisitedRandomNameKLN1111111() throws EncoderException {
this.checkEncodingVariations("KLN1111111", new String[]{
@@ -167,8 +164,7 @@ public class Caverphone2Test extends StringEncoderAbstractTest<Caverphone2> {
/**
* See http://caversham.otago.ac.nz/files/working/ctp150804.pdf
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testCaverphoneRevisitedRandomNameTN11111111() throws EncoderException {
this.checkEncodingVariations("TN11111111", new String[]{
@@ -246,8 +242,7 @@ public class Caverphone2Test extends StringEncoderAbstractTest<Caverphone2> {
/**
* See http://caversham.otago.ac.nz/files/working/ctp150804.pdf
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testCaverphoneRevisitedRandomNameTTA1111111() throws EncoderException {
this.checkEncodingVariations("TTA1111111", new String[]{
@@ -324,8 +319,7 @@ public class Caverphone2Test extends StringEncoderAbstractTest<Caverphone2> {
/**
* See http://caversham.otago.ac.nz/files/working/ctp150804.pdf
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testCaverphoneRevisitedRandomWords() throws EncoderException {
this.checkEncodingVariations("RTA1111111", new String[]{"rather", "ready", "writer"});
diff --git a/src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java b/src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java
index 95e3bb1..ac109ae 100644
--- a/src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java
+++ b/src/test/java/org/apache/commons/codec/language/ColognePhoneticTest.java
@@ -115,8 +115,7 @@ public class ColognePhoneticTest extends StringEncoderAbstractTest<ColognePhonet
/**
* Tests [CODEC-122]
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testAychlmajrForCodec122() throws EncoderException {
this.checkEncoding("04567", "Aychlmajr");
diff --git a/src/test/java/org/apache/commons/codec/language/DaitchMokotoffSoundexTest.java b/src/test/java/org/apache/commons/codec/language/DaitchMokotoffSoundexTest.java
index 309a70c..ebf6012 100644
--- a/src/test/java/org/apache/commons/codec/language/DaitchMokotoffSoundexTest.java
+++ b/src/test/java/org/apache/commons/codec/language/DaitchMokotoffSoundexTest.java
@@ -89,8 +89,7 @@ public class DaitchMokotoffSoundexTest extends StringEncoderAbstractTest<DaitchM
/**
* Test data from http://www.myatt.demon.co.uk/sxalg.htm
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testEncodeIgnoreHyphens() throws EncoderException {
this.checkEncodingVariations("565463", new String[] { "KINGSMITH", "-KINGSMITH", "K-INGSMITH", "KI-NGSMITH",
diff --git a/src/test/java/org/apache/commons/codec/language/NysiisTest.java b/src/test/java/org/apache/commons/codec/language/NysiisTest.java
index 5362908..eacaef4 100644
--- a/src/test/java/org/apache/commons/codec/language/NysiisTest.java
+++ b/src/test/java/org/apache/commons/codec/language/NysiisTest.java
@@ -38,8 +38,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
* @param testValues
* an array of String pairs where each pair's first element is the input and the second element the
* expected encoding.
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
private void assertEncodings(final String[]... testValues) throws EncoderException {
for (final String[] arr : testValues) {
Assert.assertEquals("Problem with " + arr[0], arr[1], this.fullNysiis.encode(arr[0]));
@@ -83,8 +82,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
* Tests data gathered from around the internet.
*
* @see <a href="http://www.dropby.com/NYSIISTextStrings.html">http://www.dropby.com/NYSIISTextStrings.html</a>
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testDropBy() throws EncoderException {
// Explanation of differences between this implementation and the one at dropby.com is
@@ -151,8 +149,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
/**
* Tests data gathered from around the internets.
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testOthers() throws EncoderException {
this.assertEncodings(
@@ -168,8 +165,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
/**
* Tests rule 1: Translate first characters of name: MAC → MCC, KN → N, K → C, PH, PF → FF, SCH → SSS
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testRule1() throws EncoderException {
this.assertEncodings(
@@ -184,8 +180,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
/**
* Tests rule 2: Translate last characters of name: EE → Y, IE → Y, DT, RT, RD, NT, ND → D
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testRule2() throws EncoderException {
this.assertEncodings(
@@ -201,8 +196,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
/**
* Tests rule 4.1: EV → AF else A, E, I, O, U → A
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testRule4Dot1() throws EncoderException {
this.assertEncodings(
@@ -217,8 +211,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
/**
* Tests rule 4.2: Q → G, Z → S, M → N
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testRule4Dot2() throws EncoderException {
this.assertEncodings(
@@ -230,8 +223,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
/**
* Tests rule 5: If last character is S, remove it.
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testRule5() throws EncoderException {
this.assertEncodings(
@@ -242,8 +234,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
/**
* Tests rule 6: If last characters are AY, replace with Y.
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testRule6() throws EncoderException {
this.assertEncodings(
@@ -254,8 +245,7 @@ public class NysiisTest extends StringEncoderAbstractTest<Nysiis> {
/**
* Tests rule 7: If last character is A, remove it.
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testRule7() throws EncoderException {
this.assertEncodings(
diff --git a/src/test/java/org/apache/commons/codec/language/SoundexTest.java b/src/test/java/org/apache/commons/codec/language/SoundexTest.java
index c9a6fec..92c8393 100644
--- a/src/test/java/org/apache/commons/codec/language/SoundexTest.java
+++ b/src/test/java/org/apache/commons/codec/language/SoundexTest.java
@@ -193,8 +193,7 @@ public class SoundexTest extends StringEncoderAbstractTest<Soundex> {
/**
* Test data from http://www.myatt.demon.co.uk/sxalg.htm
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testEncodeIgnoreHyphens() throws EncoderException {
this.checkEncodingVariations("K525", new String[]{
@@ -245,8 +244,7 @@ public class SoundexTest extends StringEncoderAbstractTest<Soundex> {
/**
* Consonants from the same code group separated by W or H are treated as one.
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testHWRuleEx3() throws EncoderException {
Assert.assertEquals("S460", this.getStringEncoder().encode("Sgler"));
@@ -286,8 +284,7 @@ public class SoundexTest extends StringEncoderAbstractTest<Soundex> {
* http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support
* /kb/articles/Q100/3/65.asp&NoWebContent=1
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testMsSqlServer2() throws EncoderException {
this.checkEncodingVariations("E625", new String[]{"Erickson", "Erickson", "Erikson", "Ericson", "Ericksen", "Ericsen"});
diff --git a/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java b/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java
index 2134c5b..306bbc3 100644
--- a/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java
+++ b/src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java
@@ -54,8 +54,7 @@ public class BeiderMorseEncoderTest extends StringEncoderAbstractTest<StringEnco
/**
* Tests we do not blow up.
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testAllChars() throws EncoderException {
final BeiderMorseEncoder bmpm = createGenericApproxEncoder();
@@ -102,8 +101,7 @@ public class BeiderMorseEncoderTest extends StringEncoderAbstractTest<StringEnco
* Tests https://issues.apache.org/jira/browse/CODEC-125?focusedCommentId=13071566&page=com.atlassian.jira.plugin.system.issuetabpanels:
* comment-tabpanel#comment-13071566
*
- * @throws EncoderException
- */
+ * @throws EncoderException for some failure scenarios */
@Test
public void testEncodeGna() throws EncoderException {
final BeiderMorseEncoder bmpm = createGenericApproxEncoder();
@@ -183,9 +181,9 @@ public class BeiderMorseEncoderTest extends StringEncoderAbstractTest<StringEnco
}
/**
- * (Un)luckily, the worse performing test because of the data in {@link #TEST_CHARS}
+ * (Un)luckily, the worse performing test because of the data in the test characters.
*
- * @throws EncoderException
+ * @throws EncoderException for some failure scenarios
*/
@Test(/* timeout = 20000L */)
public void testSpeedCheck() throws EncoderException {
[commons-codec] 04/05: Remove javadoc references to non-visible
fields.
Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git
commit 242d3fec8cc32e08a01f03b03962161febb06425
Author: aherbert <ah...@apache.org>
AuthorDate: Thu Nov 28 10:44:58 2019 +0000
Remove javadoc references to non-visible fields.
---
src/main/java/org/apache/commons/codec/binary/BaseNCodec.java | 6 +++---
.../java/org/apache/commons/codec/language/DoubleMetaphone.java | 2 +-
src/main/java/org/apache/commons/codec/language/Metaphone.java | 2 +-
src/main/java/org/apache/commons/codec/language/Soundex.java | 9 +++------
src/main/java/org/apache/commons/codec/net/QCodec.java | 2 +-
5 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java b/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java
index 4f24538..fb254e3 100644
--- a/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java
+++ b/src/main/java/org/apache/commons/codec/binary/BaseNCodec.java
@@ -179,7 +179,7 @@ public abstract class BaseNCodec implements BinaryEncoder, BinaryDecoder {
private final int chunkSeparatorLength;
/**
- * Note <code>lineLength</code> is rounded down to the nearest multiple of {@link #encodedBlockSize}
+ * Note <code>lineLength</code> is rounded down to the nearest multiple of the encoded block size.
* If <code>chunkSeparatorLength</code> is zero, then chunking is disabled.
* @param unencodedBlockSize the size of an unencoded block (e.g. Base64 = 3)
* @param encodedBlockSize the size of an encoded block (e.g. Base64 = 4)
@@ -192,7 +192,7 @@ public abstract class BaseNCodec implements BinaryEncoder, BinaryDecoder {
}
/**
- * Note <code>lineLength</code> is rounded down to the nearest multiple of {@link #encodedBlockSize}
+ * Note <code>lineLength</code> is rounded down to the nearest multiple of the encoded block size.
* If <code>chunkSeparatorLength</code> is zero, then chunking is disabled.
* @param unencodedBlockSize the size of an unencoded block (e.g. Base64 = 3)
* @param encodedBlockSize the size of an encoded block (e.g. Base64 = 4)
@@ -234,7 +234,7 @@ public abstract class BaseNCodec implements BinaryEncoder, BinaryDecoder {
/**
* Get the default buffer size. Can be overridden.
*
- * @return {@link #DEFAULT_BUFFER_SIZE}
+ * @return the default buffer size.
*/
protected int getDefaultBufferSize() {
return DEFAULT_BUFFER_SIZE;
diff --git a/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java b/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java
index ede1e46..0d8640b 100644
--- a/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java
+++ b/src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java
@@ -25,7 +25,7 @@ import org.apache.commons.codec.binary.StringUtils;
* Encodes a string into a double metaphone value. This Implementation is based on the algorithm by <CITE>Lawrence
* Philips</CITE>.
* <p>
- * This class is conditionally thread-safe. The instance field {@link #maxCodeLen} is mutable
+ * This class is conditionally thread-safe. The instance field for the maximum code length is mutable
* {@link #setMaxCodeLen(int)} but is not volatile, and accesses are not synchronized. If an instance of the class is
* shared between threads, the caller needs to ensure that suitable synchronization is used to ensure safe publication
* of the value between threads, and must not invoke {@link #setMaxCodeLen(int)} after initial setup.
diff --git a/src/main/java/org/apache/commons/codec/language/Metaphone.java b/src/main/java/org/apache/commons/codec/language/Metaphone.java
index ae4425a..b38a518 100644
--- a/src/main/java/org/apache/commons/codec/language/Metaphone.java
+++ b/src/main/java/org/apache/commons/codec/language/Metaphone.java
@@ -42,7 +42,7 @@ import org.apache.commons.codec.StringEncoder;
* For more information, see <a href="https://issues.apache.org/jira/browse/CODEC-57">CODEC-57</a>.
* <p>
* This class is conditionally thread-safe.
- * The instance field {@link #maxCodeLen} is mutable {@link #setMaxCodeLen(int)}
+ * The instance field for maximum code length is mutable {@link #setMaxCodeLen(int)}
* but is not volatile, and accesses are not synchronized.
* If an instance of the class is shared between threads, the caller needs to ensure that suitable synchronization
* is used to ensure safe publication of the value between threads, and must not invoke {@link #setMaxCodeLen(int)}
diff --git a/src/main/java/org/apache/commons/codec/language/Soundex.java b/src/main/java/org/apache/commons/codec/language/Soundex.java
index 5eac90c..0a4b767 100644
--- a/src/main/java/org/apache/commons/codec/language/Soundex.java
+++ b/src/main/java/org/apache/commons/codec/language/Soundex.java
@@ -24,9 +24,8 @@ import org.apache.commons.codec.StringEncoder;
* Encodes a string into a Soundex value. Soundex is an encoding used to relate similar names, but can also be used as a
* general purpose scheme to find word with similar phonemes.
*
- * This class is thread-safe.
- * Although not strictly immutable, the {@link #maxLength} field is not actually used.
- *
+ * <p>This class is thread-safe.
+ * Although not strictly immutable, the mutable fields are not actually used.</p>
*/
public class Soundex implements StringEncoder {
@@ -53,7 +52,6 @@ public class Soundex implements StringEncoder {
* <b>Note that letters H and W are treated specially.</b>
* They are ignored (after the first letter) and don't act as separators
* between consonants with the same code.
- * @see #US_ENGLISH_MAPPING
*/
// ABCDEFGHIJKLMNOPQRSTUVWXYZ
public static final String US_ENGLISH_MAPPING_STRING = "01230120022455012623010202";
@@ -72,7 +70,6 @@ public class Soundex implements StringEncoder {
* Apart from when they appear as the first letter, they are ignored.
* They don't act as separators between duplicate codes.
*
- * @see #US_ENGLISH_MAPPING
* @see #US_ENGLISH_MAPPING_STRING
*/
public static final Soundex US_ENGLISH = new Soundex();
@@ -133,7 +130,7 @@ public class Soundex implements StringEncoder {
* Creates an instance using US_ENGLISH_MAPPING
*
* @see Soundex#Soundex(char[])
- * @see Soundex#US_ENGLISH_MAPPING
+ * @see Soundex#US_ENGLISH_MAPPING_STRING
*/
public Soundex() {
this.soundexMapping = US_ENGLISH_MAPPING;
diff --git a/src/main/java/org/apache/commons/codec/net/QCodec.java b/src/main/java/org/apache/commons/codec/net/QCodec.java
index 221dac7..5f056df 100644
--- a/src/main/java/org/apache/commons/codec/net/QCodec.java
+++ b/src/main/java/org/apache/commons/codec/net/QCodec.java
@@ -37,7 +37,7 @@ import org.apache.commons.codec.StringEncoder;
* handling software.
* <p>
* This class is conditionally thread-safe.
- * The instance field {@link #encodeBlanks} is mutable {@link #setEncodeBlanks(boolean)}
+ * The instance field for encoding blanks is mutable {@link #setEncodeBlanks(boolean)}
* but is not volatile, and accesses are not synchronised.
* If an instance of the class is shared between threads, the caller needs to ensure that suitable synchronisation
* is used to ensure safe publication of the value between threads, and must not invoke