if ( this.debug ) { System.err.println ( "WriteRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx ); } if ( this.outStream == null ) throw new IOException ( "writing to an input buffer" ); if ( (offset + this.recordSize) > buf.length ) throw new IOException ( "record has length '" + buf.length + "' with offset '" + offset + "' which is less than the record size of '" + this.recordSize + "'" ); if ( this.currRecIdx >= this.recsPerBlock ) { this.writeBlock(); } System.arraycopy( buf, offset, this.blockBuffer, (this.currRecIdx * this.recordSize), this.recordSize ); this.currRecIdx++;
if ( this.debug ) { System.err.println ( "WriteRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx ); } if ( this.outStream == null ) throw new IOException ( "writing to an input buffer" ); if ( record.length != this.recordSize ) throw new IOException ( "record to write has length '" + record.length + "' which is not the record size of '" + this.recordSize + "'" ); if ( this.currRecIdx >= this.recsPerBlock ) { this.writeBlock(); } System.arraycopy( record, 0, this.blockBuffer, (this.currRecIdx * this.recordSize), this.recordSize ); this.currRecIdx++;
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/installer/TarBuffer.java File path: /jEdit-4.2/src/installer/TarBuffer.java
Method name: void writeRecord(byte[], int) Method name: void writeRecord(byte[])
Number of AST nodes: 10 Number of AST nodes: 10
1
if ( this.debug )
1
if ( this.debug )
2
			{
2
			{
3
			System.err.println
3
			System.err.println
4
				( "WriteRecord: recIdx = " + this.currRecIdx
4
				( "WriteRecord: recIdx = " + this.currRecIdx
5
					+ " blkIdx = " + this.currBlkIdx );
5
					+ " blkIdx = " + this.currBlkIdx );
6
			}
6
			}
7
		if ( this.outStream == null )
7
		if ( this.outStream == null )
8
			throw new IOException
8
			throw new IOException
9
				( "writing to an input buffer" );
9
				( "writing to an input buffer" );
10
		if ( (offset + this.recordSize) > buf.length )
10
		if ( record.length != this.recordSize )
11
			throw new IOException
11
			throw new IOException
12
				( "record has length '" + buf.length
12
				( "record to write has length '" + record.length
13
					+ "' with offset '" + offset
13
					+ "' w
14
					+ "' which is less than the record size of '"
14
hich is not the record size of '"
15
					+ this.recordSize + "'" );
15
					+ this.recordSize + "'" );
16
		if ( this.currRecIdx >= this.recsPerBlock )
16
		if ( this.currRecIdx >= this.recsPerBlock )
17
			{
17
			{
18
			this.writeBlock();
18
			this.writeBlock();
19
			}
19
			}
20
		System.arraycopy(
20
		System.arraycopy(
21
			buf, offset,
21
			record, 0,
22
			this.blockBuffer, (this.currRecIdx * this.recordSize),
22
			this.blockBuffer, (this.currRecIdx * this.recordSize),
23
			this.recordSize );
23
			this.recordSize );
24
		this.currRecIdx++;
24
		this.currRecIdx++;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)6.3
Clones locationClones are declared in the same class
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)3.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (this.debug)
    1
    if (this.debug)
    2
    System.err.println("WriteRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx);
    2
    System.err.println("WriteRecord: recIdx = " + this.currRecIdx + " blkIdx = " + this.currBlkIdx);
    3
    if (this.outStream == null)
    3
    if (this.outStream == null)
    4
    throw new IOException("writing to an input buffer");
    4
    throw new IOException("writing to an input buffer");
                                                                                  
    5
    if (record.length != this.recordSize)
                                                                                                                                                                                                                                                                                  
    6
    throw new IOException("record to write has length '" + record.length + "' which is not the record size of '" + this.recordSize + "'");
    Preondition Violations
    Unmatched throw new IOException("record to write has length '" + record.length + "' which is not the record size of '"+ this.recordSize+ "'");
    6
    throw new IOException("record to write has length '" + record.length + "' which is not the record size of '" + this.recordSize + "'");
    5
    if ((offset + this.recordSize) > buf.length)
                                                                                                
    6
    throw new IOException("record has length '" + buf.length + "' with offset '" + offset + "' which is less than the record size of '" + this.recordSize + "'");
    6
    throw new IOException("record has length '" + buf.length + "' with offset '" + offset + "' which is less than the record size of '" + this.recordSize + "'");
    Preondition Violations
    Unmatched throw new IOException("record has length '" + buf.length + "' with offset '"+ offset+ "' which is less than the record size of '"+ this.recordSize+ "'");
                                                                                                                                                                                                                                                                                                                            
    7
    if (this.currRecIdx >= this.recsPerBlock)
    7
    if (this.currRecIdx >= this.recsPerBlock)
    8
    this.writeBlock();
    8
    this.writeBlock();
    Precondition Violations (2)
    Row Violation
    1Unmatched throw new IOException("record to write has length '" + record.length + "' which is not the record size of '"+ this.recordSize+ "'");
    2Unmatched throw new IOException("record has length '" + buf.length + "' with offset '"+ offset+ "' which is less than the record size of '"+ this.recordSize+ "'");