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 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 6.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 34 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 3.6 |
Clone type | Type 3 |
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 + "'"); | ||||
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 + "'"); |
| | ||||
7 | if (this.currRecIdx >= this.recsPerBlock) | 7 | if (this.currRecIdx >= this.recsPerBlock) | ||||
8 | this.writeBlock(); | 8 | this.writeBlock(); |
Row | Violation |
---|---|
1 | Unmatched throw new IOException("record to write has length '" + record.length + "' which is not the record size of '"+ this.recordSize+ "'"); |
2 | Unmatched throw new IOException("record has length '" + buf.length + "' with offset '"+ offset+ "' which is less than the record size of '"+ this.recordSize+ "'"); |