Apache Commons logo Commons Codec

CPD Results

The following document contains the results of PMD's CPD 7.20.0.

Duplications

File Line
org/apache/commons/codec/language/Caverphone1.java 70
org/apache/commons/codec/language/Caverphone2.java 73
txt = txt.replaceAll("^enough", "enou2f");
        txt = txt.replaceAll("^gn", "2n");

        // End
        txt = txt.replaceAll("mb$", "m2");

        // 4. Handle replacements
        txt = txt.replace("cq", "2q");
        txt = txt.replace("ci", "si");
        txt = txt.replace("ce", "se");
        txt = txt.replace("cy", "sy");
        txt = txt.replace("tch", "2ch");
        txt = txt.replace("c", "k");
        txt = txt.replace("q", "k");
        txt = txt.replace("x", "k");
        txt = txt.replace("v", "f");
        txt = txt.replace("dg", "2g");
        txt = txt.replace("tio", "sio");
        txt = txt.replace("tia", "sia");
        txt = txt.replace("d", "t");
        txt = txt.replace("ph", "fh");
        txt = txt.replace("b", "p");
        txt = txt.replace("sh", "s2");
        txt = txt.replace("z", "s");
        txt = txt.replaceAll("^[aeiou]", "A");
        // 3 is a temporary placeholder marking a vowel
        txt = txt.replaceAll("[aeiou]", "3");
        txt = txt.replace("3gh3", "3kh3");
File Line
org/apache/commons/codec/binary/Base16.java 114
org/apache/commons/codec/binary/Base32.java 187
private static final byte[] UPPER_CASE_DECODE_TABLE = {
            //  0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
             0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1, // 30-3f 0-9
            -1, 10, 11, 12, 13, 14, 15                                      // 40-46 A-F
File Line
org/apache/commons/codec/binary/Base16.java 114
org/apache/commons/codec/binary/Base16.java 135
org/apache/commons/codec/binary/Base32.java 187
private static final byte[] UPPER_CASE_DECODE_TABLE = {
            //  0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
             0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1, // 30-3f 0-9
            -1, 10, 11, 12, 13, 14, 15                                      // 40-46 A-F
File Line
org/apache/commons/codec/binary/Base64.java 260
org/apache/commons/codec/binary/Base64.java 297
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63, // 20-2f + - /
            52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, // 30-3f 0-9
            -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, // 40-4f A-O
            15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63, // 50-5f P-Z _
            -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, // 60-6f a-o
            41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51                      // 70-7a p-z
    };

    /**
     * This array is a lookup table that translates Unicode characters drawn from the "Base64 Alphabet" (as specified in
     * <a href="https://www.ietf.org/rfc/rfc2045#:~:text=Table%201%3A%20The%20Base64%20Alphabet">RFC 2045 Table 1: The Base64 Alphabet</a>) into their 6-bit
     * positive integer equivalents. Characters that are not in the Base64 alphabet but fall within the bounds of the array are translated to -1. This decoding
     * table handles only the standard base64 characters, such as '+' and '/'. The "url-safe" characters such as '-' and '_' are not supported by the table.
     */
    private static final byte[] STANDARD_DECODE_TABLE = {
File Line
org/apache/commons/codec/binary/Base16.java 114
org/apache/commons/codec/binary/Base32.java 154
org/apache/commons/codec/binary/Base32.java 187
private static final byte[] UPPER_CASE_DECODE_TABLE = {
            //  0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base16.java 116
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base16.java 137
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base16.java 116
org/apache/commons/codec/binary/Base16.java 137
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 189
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base16.java 137
org/apache/commons/codec/binary/Base32.java 189
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base32.java 154
org/apache/commons/codec/binary/Base64.java 256
private static final byte[] DECODE_TABLE = {
         //  0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base16.java 114
org/apache/commons/codec/binary/Base64.java 293
private static final byte[] UPPER_CASE_DECODE_TABLE = {
            //  0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base64.java 276
org/apache/commons/codec/binary/Base64.java 295
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, // 20-2f + /
File Line
org/apache/commons/codec/binary/Base64.java 258
org/apache/commons/codec/binary/Base64.java 295
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63, // 20-2f + - /
File Line
org/apache/commons/codec/binary/Base16.java 116
org/apache/commons/codec/binary/Base64.java 295
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base16.java 137
org/apache/commons/codec/binary/Base64.java 295
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base16.java 114
org/apache/commons/codec/binary/Base64.java 256
org/apache/commons/codec/binary/Base64.java 274
org/apache/commons/codec/binary/Base64.java 293
private static final byte[] UPPER_CASE_DECODE_TABLE = {
            //  0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base64.java 258
org/apache/commons/codec/binary/Base64.java 295
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63, // 20-2f + - /
File Line
org/apache/commons/codec/binary/Base16.java 137
org/apache/commons/codec/binary/Base64.java 258
org/apache/commons/codec/binary/Base64.java 276
org/apache/commons/codec/binary/Base64.java 295
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base64.java 258
org/apache/commons/codec/binary/Base64.java 276
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base64.java 221
org/apache/commons/codec/binary/Base64.java 234
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', '+', '/'
File Line
org/apache/commons/codec/digest/MurmurHash3.java 570
org/apache/commons/codec/digest/MurmurHash3.java 1071
case 7:
            k1 ^= ((long) data[index + 6] & 0xff) << 48;
            // falls-through
        case 6:
            k1 ^= ((long) data[index + 5] & 0xff) << 40;
            // falls-through
        case 5:
            k1 ^= ((long) data[index + 4] & 0xff) << 32;
            // falls-through
        case 4:
            k1 ^= ((long) data[index + 3] & 0xff) << 24;
            // falls-through
        case 3:
            k1 ^= ((long) data[index + 2] & 0xff) << 16;
            // falls-through
        case 2:
            k1 ^= ((long) data[index + 1] & 0xff) << 8;
            // falls-through
        case 1:
            k1 ^= data[index] & 0xff;
File Line
org/apache/commons/codec/language/Caverphone1.java 96
org/apache/commons/codec/language/Caverphone2.java 103
txt = txt.replaceAll("[aeiou]", "3");
        txt = txt.replace("3gh3", "3kh3");
        txt = txt.replace("gh", "22");
        txt = txt.replace("g", "k");
        txt = txt.replaceAll("s+", "S");
        txt = txt.replaceAll("t+", "T");
        txt = txt.replaceAll("p+", "P");
        txt = txt.replaceAll("k+", "K");
        txt = txt.replaceAll("f+", "F");
        txt = txt.replaceAll("m+", "M");
        txt = txt.replaceAll("n+", "N");
        txt = txt.replace("w3", "W3");
        txt = txt.replace("wy", "Wy"); // 1.0 only
File Line
org/apache/commons/codec/binary/Base16.java 116
org/apache/commons/codec/binary/Base16.java 140
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base64.java 258
org/apache/commons/codec/binary/Base64.java 258
org/apache/commons/codec/binary/Base64.java 258
org/apache/commons/codec/binary/Base64.java 258
org/apache/commons/codec/binary/Base64.java 276
org/apache/commons/codec/binary/Base64.java 276
org/apache/commons/codec/binary/Base64.java 276
org/apache/commons/codec/binary/Base64.java 276
org/apache/commons/codec/binary/Base64.java 295
org/apache/commons/codec/binary/Base64.java 295
org/apache/commons/codec/binary/Base64.java 295
org/apache/commons/codec/binary/Base64.java 295
org/apache/commons/codec/binary/Base64.java 295
org/apache/commons/codec/binary/Base64.java 295
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base16.java 137
org/apache/commons/codec/binary/Base16.java 140
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base16.java 137
org/apache/commons/codec/binary/Base16.java 140
org/apache/commons/codec/binary/Base32.java 156
org/apache/commons/codec/binary/Base32.java 189
org/apache/commons/codec/binary/Base64.java 258
org/apache/commons/codec/binary/Base64.java 276
org/apache/commons/codec/binary/Base64.java 295
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 00-0f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10-1f
            -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20-2f
File Line
org/apache/commons/codec/binary/Base64.java 260
org/apache/commons/codec/binary/Base64.java 278
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63, // 20-2f + - /
            52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, // 30-3f 0-9
            -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, // 40-4f A-O
            15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63, // 50-5f P-Z _
File Line
org/apache/commons/codec/binary/Base32.java 685
org/apache/commons/codec/binary/Base64.java 1101
break;
            default:
                throw new IllegalStateException("Impossible modulus " + context.modulus);
            }
            context.currentLinePos += context.pos - savedPos; // keep track of current line position
            // if currentPos == 0 we are at the start of a line, so don't add CRLF
            if (lineLength > 0 && context.currentLinePos > 0) { // add chunk separator if required
                System.arraycopy(lineSeparator, 0, buffer, context.pos, lineSeparator.length);
                context.pos += lineSeparator.length;
            }
        } else {
            for (int i = 0; i < inAvail; i++) {
                final byte[] buffer = ensureBufferSize(encodeSize, context);
                context.modulus = (context.modulus + 1) % BYTES_PER_UNENCODED_BLOCK;
                int b = input[inPos++];
File Line
org/apache/commons/codec/binary/Base64.java 278
org/apache/commons/codec/binary/Base64.java 297
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, // 20-2f + /
            52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, // 30-3f 0-9
            -1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, // 40-4f A-O
            15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, // 50-5f P-Z
File Line
org/apache/commons/codec/digest/MurmurHash3.java 712
org/apache/commons/codec/digest/MurmurHash3.java 912
public static int hash32(final byte[] data, final int offset, final int length, final int seed) {
        int hash = seed;
        final int nblocks = length >> 2;
        // body
        for (int i = 0; i < nblocks; i++) {
            final int index = offset + (i << 2);
            final int k = MurmurHash.getLittleEndianInt(data, index);
            hash = mix32(k, hash);
        }
        // tail
        // Note: This fails to apply masking using 0xff to the 3 remaining bytes.
        final int index = offset + (nblocks << 2);
        int k1 = 0;
        switch (offset + length - index) {
        case 3:
            k1 ^= data[index + 2] << 16;