@SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j];
if (entry.getKey() == key)
{
return j;
}
@SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j];
if (entry.getKey() == key)
{
return entry;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEMap.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEMap.java
|
Method name: int entryIndexForKey(int, int, Object)
|
|
Method name: Entry entryForKey(int, int, Object)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | @SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j];↵ | | 1 | @SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j];↵
|
2 | if (entry.getKey() == key) ↵ | | 2 | if (entry.getKey() == key) ↵
|
3 | {↵ | | 3 | {↵
|
4 | return j;↵ | | 4 | return entry;↵
|
5 | } | | 5 | }
|
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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 6 |
-
{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.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
15 | @SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j]; | | 11 | @SuppressWarnings("unchecked") Entry<K, V> entry = (Entry<K, V>)entries[j]; |
16 | if (entry.getKey() == key) | | 12 | if (entry.getKey() == key) |
| | | 13 | |
17 | | | | |
Precondition Violations (4)
Row |
Violation |
1 | Unmatched statement return entry; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched return entry; |
3 | Unmatched return j; |
4 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables entry |