int c = super.read();
captureFeature(c);
return c;
int len = value.length();
writeInt(len);
out.write(value.unsafeBytes(), value.begin(), len);
Clone fragments detected by clone detection tool
File path: /jruby-1.4.0/src/org/jruby/lexer/yacc/CapturingByteListLexerSource.java
|
|
File path: /jruby-1.4.0/src/org/jruby/runtime/marshal/MarshalStream.java
|
Method name: int read()
|
|
Method name: void writeString(ByteList)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | int c = super.read();↵ | | 1 | int ↵
|
2 | captureFeature(c);↵ | | |
|
3 | return c↵ | | 2 | len = value.length();↵
|
| | | 3 | writeInt(len);↵
|
4 | ; | | 4 | out.write(value.unsafeBytes(), value.begin(), len);
|
See real code fragment |
|
See real code fragment |
Summary
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) | 0.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | int c = super.read(); | | 1 | int len = value.length(); |
2 | captureFeature(c); | | 2 | writeInt(len); |
| | | 3 | out.write(value.unsafeBytes(), value.begin(), len); |
3 | return c; | | | |
Precondition Violations (4)
Row |
Violation |
1 | Expression captureFeature(c) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression writeInt(len) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression captureFeature(c) is a void method call, and thus it cannot be parameterized |
4 | Expression writeInt(len) is a void method call, and thus it cannot be parameterized |