EAnnotation eAnnotation = ecoreFactory.createEAnnotation();
eAnnotation.setSource(source);
EMap<String, String> theDetails = eAnnotation.getDetails();
for (int i = 1; i < details.length; i += 2)
{
theDetails.put(details[i - 1], details[i]);
}
EAnnotation eAnnotation = ecoreFactory.createEAnnotation();
eAnnotation.setSource(source);
EMap<String, String> theDetails = eAnnotation.getDetails();
for (int i = 1; i < details.length; i += 2)
{
theDetails.put(details[i - 1], details[i]);
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EPackageImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EPackageImpl.java
|
Method name: void addAnnotation(ENamedElement, String, String[])
|
|
Method name: void addAnnotation(ENamedElement, int, String, String[])
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | EAnnotation eAnnotation = ecoreFactory.createEAnnotation();↵ | | 1 | EAnnotation eAnnotation = ecoreFactory.createEAnnotation();↵
|
2 | eAnnotation.setSource(source);↵ | | 2 | eAnnotation.setSource(source);↵
|
3 | EMap<String, String> theDetails = eAnnotation.getDetails();↵ | | 3 | EMap<String, String> theDetails = eAnnotation.getDetails();↵
|
4 | for (int i = 1; i < details.length; i += 2)↵ | | 4 | for (int i = 1; i < details.length; i += 2)↵
|
5 | {↵ | | 5 | {↵
|
6 | theDetails.put(details[i - 1], details[i]);↵ | | 6 | theDetails.put(details[i - 1], details[i]);↵
|
7 | } | | 7 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 13 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 5 |
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.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | EAnnotation eAnnotation = ecoreFactory.createEAnnotation(); | | 1 | EAnnotation eAnnotation = ecoreFactory.createEAnnotation(); |
2 | eAnnotation.setSource(source); | | 2 | eAnnotation.setSource(source); |
3 | EMap<String, String> theDetails = eAnnotation.getDetails(); | | 3 | EMap<String, String> theDetails = eAnnotation.getDetails(); |
4 | for (int i = 1; i < details.length; i += 2) | | 4 | for (int i = 1; i < details.length; i += 2) |
5 | theDetails.put(details[i - 1], details[i]); | | 5 | theDetails.put(details[i - 1], details[i]); |
Precondition Violations (0)
Row |
Violation |