File path: /jruby-1.4.0/src/org/jruby/RubyTime.java | File path: /jruby-1.4.0/src/org/jruby/RubyFileStat.java | |||
Method name: IRubyObject initialize_copy(IRubyObject)
|
Method name: IRubyObject initialize_copy(IRubyObject)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (!(original instanceof RubyTime)) {↵ | 1 | if (!(original instanceof RubyFileStat)) {↵ | |
2 | throw getRuntime().newTypeError("Expecting an instance of class Time");↵ | 2 | throw getRuntime().newTypeError("wrong argument class");↵ | |
3 | }↵ | 3 | }↵ | |
4 | ↵ | 4 | ↵ | |
5 | RubyTime originalTime = (RubyTime) original;↵ | 5 | RubyFileStat originalFileStat = (RubyFileStat) original;↵ | |
6 | ↵ | 6 | ↵ | |
7 | // We can just use dt, since it is immutable↵ | 7 | ↵ | |
8 | dt = originalTime.dt;↵ | 8 | file = originalFileStat.file;↵ | |
9 | usec = originalTime.usec;↵ | 9 | stat = originalFileStat.stat;↵ | |
10 | ↵ | 10 | ↵ | |
11 | return this; | 11 |
| |
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) | 0.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 20 |
Number of mapped statements | 4 |
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) | 1.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (!(original instanceof RubyTime)) |
| 1 | if (!(original instanceof RubyFileStat)) | |||||||||||||||||||
2 | throw getRuntime().newTypeError("Expecting an instance of class Time"); |
| 2 | throw getRuntime().newTypeError("wrong argument class"); | |||||||||||||||||||
3 | RubyTime originalTime = (RubyTime)original; |
| 3 | RubyFileStat originalFileStat = (RubyFileStat)original; | |||||||||||||||||||
| 4 | file = originalFileStat.file; | |||||||||||||||||||||
4 | dt = originalTime.dt; | | |||||||||||||||||||||
| 5 | stat = originalFileStat.stat; | |||||||||||||||||||||
5 | usec = originalTime.usec; | | |||||||||||||||||||||
6 | return this; | 6 | return this; |
Row | Violation |
---|---|
1 | Clone fragment #1 returns variable originalTime with type org.jruby.RubyTime , while Clone fragment #2 returns variable originalFileStat with type org.jruby.RubyFileStat |