CPD Results

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

Duplications

FileLine
org/jscsi/initiator/connection/state/WriteFirstBurstState.java100
org/jscsi/initiator/connection/state/WriteSecondBurstState.java116
        while (bytes2Transfer > 0 && iterator.hasNext()) {
            if (bytes2Transfer <= maxRecvDataSegmentLength) {
                dataSegmentChunk = iterator.next(bytes2Transfer);
                finalFlag = true;
            } else {
                dataSegmentChunk = iterator.next(maxRecvDataSegmentLength);
                finalFlag = false;
            }

            protocolDataUnit = protocolDataUnitFactory.create(false, finalFlag, OperationCode.SCSI_DATA_OUT, connection.getSetting(OperationalTextKey.HEADER_DIGEST), connection.getSetting(OperationalTextKey.DATA_DIGEST));
            protocolDataUnit.getBasicHeaderSegment().setInitiatorTaskTag(connection.getSession().getInitiatorTaskTag());

            dataOut = (DataOutParser) protocolDataUnit.getBasicHeaderSegment().getParser();

            dataOut.setTargetTransferTag(targetTransferTag);
            dataOut.setDataSequenceNumber(dataSequenceNumber++);
            dataOut.setBufferOffset(bufferOffset);
            bufferOffset += maxRecvDataSegmentLength;

            protocolDataUnit.setDataSegment(dataSegmentChunk);

            protocolDataUnits.offer(protocolDataUnit);
            bytes2Transfer -= maxRecvDataSegmentLength;
        }

        connection.send(protocolDataUnits);

        connection.nextState(new WriteSecondResponseState(connection, iterator, dataSequenceNumber, bufferOffset));