Apache Commons logo Commons Codec

CPD Results

The following document contains the results of PMD's CPD 7.14.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 56
org/apache/commons/codec/binary/Base32.java 151
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 56
org/apache/commons/codec/binary/Base16.java 77
org/apache/commons/codec/binary/Base32.java 151
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 56
org/apache/commons/codec/binary/Base32.java 120
org/apache/commons/codec/binary/Base32.java 151
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 58
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
-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 79
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
-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 58
org/apache/commons/codec/binary/Base16.java 79
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 153
-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 79
org/apache/commons/codec/binary/Base32.java 153
-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 120
org/apache/commons/codec/binary/Base64.java 154
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 56
org/apache/commons/codec/binary/Base64.java 154
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 58
org/apache/commons/codec/binary/Base64.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 79
org/apache/commons/codec/binary/Base64.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/Base64.java 121
org/apache/commons/codec/binary/Base64.java 133
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 573
org/apache/commons/codec/digest/MurmurHash3.java 1082
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 58
org/apache/commons/codec/binary/Base16.java 82
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base64.java 156
org/apache/commons/codec/binary/Base64.java 156
org/apache/commons/codec/binary/Base64.java 156
org/apache/commons/codec/binary/Base64.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 79
org/apache/commons/codec/binary/Base16.java 82
-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 79
org/apache/commons/codec/binary/Base16.java 82
org/apache/commons/codec/binary/Base32.java 122
org/apache/commons/codec/binary/Base32.java 153
org/apache/commons/codec/binary/Base64.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/Base32.java 599
org/apache/commons/codec/binary/Base64.java 860
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/digest/MurmurHash3.java 715
org/apache/commons/codec/digest/MurmurHash3.java 915
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;