File path: /jruby-1.4.0/test/org/jruby/javasupport/test/Room.java | File path: /jruby-1.4.0/src/org/jruby/RubyHash.java | |||
Method name: boolean equals(Object)
|
Method name: boolean equals(Object)
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | if (! (obj instanceof Room))↵ | 1 | if(!(other instanceof R↵ | |
2 | return false;↵ | |||
3 | Room that = (Room) obj;↵ | |||
4 | return nam↵ | 2 | ubyHashEntry)) return false;↵ | |
3 | RubyHashEntry otherEntry = (RubyHashEntry)other;↵ | |||
4 | ↵ | |||
5 | return (key == otherEntry.key || key.eql(otherEntry.key)) &&↵ | |||
5 | e.equals(that.name); | 6 | (value == otherEntry.value || value.equals(otherEntry.value)); | |
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 8 |
Number of mapped statements | 3 |
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.8 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (!(obj instanceof Room)) |
| 1 | if (!(other instanceof RubyHashEntry)) | ||||||||||||||
2 | return false; | 2 | return false; | |||||||||||||||
| 3 | RubyHashEntry otherEntry = (RubyHashEntry)other; | ||||||||||||||||
3 | Room that = (Room)obj; | | ||||||||||||||||
4 | return name.equals(that.name); |
| 4 | return (key == otherEntry.key || key.eql(otherEntry.key)) && (value == otherEntry.value || value.equals(otherEntry.value)); |
Row | Violation |
---|---|
1 | Type boolean of variable obj instanceof Room does not match with type boolean of variable other instanceof RubyHashEntry |