File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaObject.java | File path: /jruby-1.4.0/src/org/jruby/javasupport/JavaObject.java | |||
Method name: IRubyObject op_equal(IRubyObject)
|
Method name: IRubyObject same(IRubyObject)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if (!(other instanceof JavaObject)) {↵ | 1 | if (!(other instanceof JavaObject)) {↵ | |
2 | other = (JavaObject)other.dataGetStruct();↵ | 2 | other = (JavaObject)other.dataGetStruct();↵ | |
3 | if (!(other instanceof JavaObject)) {↵ | 3 | if (!(other instanceof JavaObject)) {↵ | |
4 | return getRuntime().getFalse();↵ | 4 | return getRuntime().getFalse();↵ | |
5 | }↵ | 5 | }↵ | |
6 | }↵ | 6 | }↵ | |
7 | if (getValue() == null && ((JavaObject) other).getValue() == null) {↵ | 7 | if (getValue() == null && ((JavaObject) other).getValue() == null) {↵ | |
8 | return getRuntime().getTrue();↵ | 8 | return getRuntime().getTrue();↵ | |
9 | }↵ | 9 | }↵ | |
10 | boolean isEqual = getValue().equals(((JavaObject) other).getValue());↵ | 10 | boolean isSame = getValue() == ((JavaObject) other).getValue();↵ | |
11 | return isEqual ? getRuntime().getTrue() : getRuntime().getFalse(); | 11 | return isSame ? getRuntime().getTrue() : getRuntime().getFalse(); | |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 16 |
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 1.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (!(other instanceof JavaObject)) | 1 | if (!(other instanceof JavaObject)) | ||||||||||||||||
2 | other = (JavaObject)other.dataGetStruct(); | 2 | other = (JavaObject)other.dataGetStruct(); | ||||||||||||||||
3 | if (!(other instanceof JavaObject)) | 3 | if (!(other instanceof JavaObject)) | ||||||||||||||||
4 | return getRuntime().getFalse(); | 4 | return getRuntime().getFalse(); | ||||||||||||||||
5 | if (getValue() == null && ((JavaObject)other).getValue() == null) | 5 | if (getValue() == null && ((JavaObject)other).getValue() == null) | ||||||||||||||||
6 | return getRuntime().getTrue(); | 6 | return getRuntime().getTrue(); | ||||||||||||||||
7 | boolean isEqual = getValue().equals(((JavaObject)other).getValue()); |
| 7 | boolean isSame = getValue() == ((JavaObject)other).getValue(); | |||||||||||||||
8 | return isEqual ? getRuntime().getTrue() : getRuntime().getFalse(); |
| 8 | return isSame ? getRuntime().getTrue() : getRuntime().getFalse(); |
Row | Violation |
---|---|
1 | Expression getValue().equals(((JavaObject)other).getValue()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression getValue() == ((JavaObject)other).getValue() cannot be parameterized, because it has dependencies to/from statements that will be extracted |