List<String> result = new ArrayList<String>();
for (StringTokenizer stringTokenizer = new StringTokenizer(constraints); stringTokenizer.hasMoreTokens();)
{
String constraint = stringTokenizer.nextToken();
result.add(constraint);
}
return result;
List<String> constraintList = new ArrayList<String>();
for (StringTokenizer stringTokenizer = new StringTokenizer(constraints); stringTokenizer.hasMoreTokens();)
{
String constraint = stringTokenizer.nextToken();
constraintList.add(constraint);
}
EcoreUtil.setConstraints(eModelElement, constraintList);
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EcoreUtil.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/importer/rose/builder/RoseEcoreBuilder.java
|
Method name: List getConstraints(EModelElement)
|
|
Method name: void setEModelElementProperties(RoseNode, EModelElement)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | List<String> result = new ArrayList<String>();↵ | | 1 | List<String> constraintList = new ArrayList<String>();↵
|
2 | for (StringTokenizer stringTokenizer = new StringTokenizer(constraints); stringTokenizer.hasMoreTokens();)↵ | | 2 | for (StringTokenizer stringTokenizer = new StringTokenizer(constraints); stringTokenizer.hasMoreTokens();)↵
|
3 | {↵ | | 3 | ↵
|
4 | ↵ | | 4 | {↵
|
5 | String constraint = stringTokenizer.nextToken();↵ | | 5 | String constraint = stringTokenizer.nextToken();↵
|
6 | result.add(constraint);↵ | | 6 | constraintList.add(constraint);↵
|
7 | }↵ | | 7 | }↵
|
8 | return result; | | 8 | EcoreUtil.setConstraints(eModelElement, constraintList);
|
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 in different classes |
Number of node comparisons | 14 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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) | 1.3 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | List<String> result = new ArrayList<String>(); | | 14 | List<String> constraintList = new ArrayList<String>(); |
6 | for (StringTokenizer stringTokenizer = new StringTokenizer(constraints); stringTokenizer.hasMoreTokens(); ) | | 15 | for (StringTokenizer stringTokenizer = new StringTokenizer(constraints); stringTokenizer.hasMoreTokens(); ) |
7 | String constraint = stringTokenizer.nextToken(); | | 16 | String constraint = stringTokenizer.nextToken(); |
8 | | | 17 | constraintList.add(constraint); |
9 | return result; | | | |
| | | 18 | EcoreUtil.setConstraints(eModelElement, constraintList); |
Precondition Violations (0)
Row |
Violation |