CPD Results

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

Duplications

File Line
nl\tno\imb\TByteBuffer.java 865
nl\tno\imb\TByteBuffer.java 965
        fBuffer[fWriteCursor] = (byte) (aValue & 0xFF);
        fBuffer[fWriteCursor + 1] = (byte) ((aValue >> 8) & 0xFF);
        fBuffer[fWriteCursor + 2] = (byte) ((aValue >> 16) & 0xFF);
        fBuffer[fWriteCursor + 3] = (byte) ((aValue >> 24) & 0xFF);
        fBuffer[fWriteCursor + 4] = (byte) ((aValue >> 32) & 0xFF);
        fBuffer[fWriteCursor + 5] = (byte) ((aValue >> 40) & 0xFF);
        fBuffer[fWriteCursor + 6] = (byte) ((aValue >> 48) & 0xFF);
        fBuffer[fWriteCursor + 7] = (byte) ((aValue >> 56) & 0xFF);
        fWriteCursor += SIZE_OF_INT64;
    }

    /**Write the specified single (float) to the byte buffer.
     * Buffer space is allocated if needed. 
     * @param aValue the single (float) to be written to the byte buffer
     */
    public void write(float aValue) {
File Line
nl\tno\imb\TByteBuffer.java 217
nl\tno\imb\TByteBuffer.java 443
        if (SIZE_OF_INT64 <= getReadAvailable()) {
            fReadCursor += SIZE_OF_INT64;
            return (long)(fBuffer[fReadCursor - 8] & 0xFF) 
                    + ((long)(fBuffer[fReadCursor - 7] & 0xFF) << 8)
                    + ((long)(fBuffer[fReadCursor - 6] & 0xFF) << 16) 
                    + ((long)(fBuffer[fReadCursor - 5] & 0xFF) << 24)
                    + ((long)(fBuffer[fReadCursor - 4] & 0xFF) << 32) 
                    + ((long)(fBuffer[fReadCursor - 3] & 0xFF) << 40)
                    + ((long)(fBuffer[fReadCursor - 2] & 0xFF) << 48) 
                    + ((long)(fBuffer[fReadCursor - 1] & 0xFF) << 56);
        } else
File Line
nl\tno\imb\TConnection.java 558
nl\tno\imb\TConnection.java 830
    private void readCommands() {
        // TODO: more like Delphi code
        int Command = TEventEntry.IC_INVALID_COMMAND;
        // define once
        // magic + command + payload size
        TByteBuffer FixedCommandPart = new TByteBuffer(MAGIC_BYTES.length + TByteBuffer.SIZE_OF_INT32
                + TByteBuffer.SIZE_OF_INT32);
        TByteBuffer Payload = new TByteBuffer();
        TByteBuffer PayloadCheck = new TByteBuffer(TByteBuffer.SIZE_OF_INT32);
        do {
            try {
                try {
                    Command = readCommand(FixedCommandPart, Payload, PayloadCheck);
                    if (Command != TEventEntry.IC_INVALID_COMMAND)
                        handleCommand(Command, Payload);
                } catch (ThreadDeath ex) {
                    Command = TEventEntry.IC_END_OF_SESSION;
                }
            } catch (Exception ex) {
                if (isConnected())
                    System.out.println("## Exception in ReadCommands loop: " + ex.getMessage());
            }
        } while ((Command != TEventEntry.IC_END_OF_SESSION) && isConnected());
File Line
nl\tno\imb\TConnection.java 560
nl\tno\imb\TConnection.java 862
        int Command = TEventEntry.IC_INVALID_COMMAND;
        // define once
        // magic + command + payload size
        TByteBuffer FixedCommandPart = new TByteBuffer(MAGIC_BYTES.length + TByteBuffer.SIZE_OF_INT32
                + TByteBuffer.SIZE_OF_INT32);
        TByteBuffer Payload = new TByteBuffer();
        TByteBuffer PayloadCheck = new TByteBuffer(TByteBuffer.SIZE_OF_INT32);
        do {
            try {
                try {
                    Command = readCommand(FixedCommandPart, Payload, PayloadCheck);
                    if (Command != TEventEntry.IC_INVALID_COMMAND)
                        handleCommand(Command, Payload);
                } catch (ThreadDeath ex) {
                    Command = TEventEntry.IC_END_OF_SESSION;
                }
            } catch (Exception ex) {
                if (isConnected())
                    System.out.println("## Exception in ReadCommands loop: " + ex.getMessage());
            }
        } while ((Command != TEventEntry.IC_END_OF_SESSION) && isConnected());
    }
File Line
nl\tno\imb\TConnection.java 831
nl\tno\imb\TConnection.java 862
            int Command = TEventEntry.IC_INVALID_COMMAND;
            // define once
            // magic + command + payload size
            TByteBuffer FixedCommandPart = new TByteBuffer(MAGIC_BYTES.length + TByteBuffer.SIZE_OF_INT32
                    + TByteBuffer.SIZE_OF_INT32);
            TByteBuffer Payload = new TByteBuffer();
            TByteBuffer PayloadCheck = new TByteBuffer(TByteBuffer.SIZE_OF_INT32);
            do {
                try {
                    try {
                        Command = readCommand(FixedCommandPart, Payload, PayloadCheck);
                        if (Command != TEventEntry.IC_INVALID_COMMAND)
                            handleCommand(Command, Payload);
                    } catch (ThreadDeath ex) {
                        Command = TEventEntry.IC_END_OF_SESSION;
                    }
                } catch (Exception ex) {
                    if (isConnected())
                        System.out.println("## Exception in ReadCommands loop: " + ex.getMessage());
                }
            } while ((Command != TEventEntry.IC_END_OF_SESSION) && isConnected() && (finputStream.available() != 0));