int position = notification.getPosition();
for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0;)
{
oldValue.remove(position);
}
int position = notification.getPosition();
for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0;)
{
oldValue.remove(position);
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/util/ChangeRecorder.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/util/ChangeRecorder.java
|
Method name: void handleFeature(EStructuralFeature, EReference, Notification, EObject)
|
|
Method name: void handleResource(Notification)
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | int position = notification.getPosition();↵ | | 1 | int position = notification.getPosition();↵
|
2 | for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0;)↵ | | 2 | for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0;)↵
|
3 | {↵ | | 3 | {↵
|
4 | oldValue.remove(position);↵ | | 4 | oldValue.remove(position);↵
|
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 | 3 |
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) | 0.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
39 | int position = notification.getPosition(); | | 33 | int position = notification.getPosition(); |
40 | for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0; ) | | 34 | for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0; ) |
41 | oldValue.remove(position); | | 35 | oldValue.remove(position); |
Precondition Violations (1)
Row |
Violation |
1 | Type java.util.List<java.lang.Object> of variable oldValue does not match with type org.eclipse.emf.common.util.EList<java.lang.Object> of variable oldValue |