Object copyType = mappingDomain.getOutputTypeClassifier(ownerType);
if (copyType != null)
{
mappingDomain.setTypeClassifier(copy, copyType);
}
Object wrapper = childrenMap.get(object);
if (wrapper != null)
{
i.set(wrapper);
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/command/InitializeCopyOverrideCommand.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/DelegatingWrapperItemProvider.java
|
Method name: void execute()
|
|
Method name: Collection> getAffectedObjects()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | Object copyType = mappingDomain.getOutputTypeClassifier(ownerType);↵ | | 1 | Object wrapper = ↵
|
| | | 2 | childrenMap.get(object);↵
|
2 | if (copyType != null)↵ | | 3 | if (wrapper != null)↵
|
3 | {↵ | | 4 | ↵
|
4 | mappingDomain.setTypeClassifier(copy, copyTy↵ | | 5 | {↵
|
5 | pe);↵ | | 6 | i.set(wrapper);↵
|
6 | } | | 7 | }
|
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 6 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 8 | Object wrapper = childrenMap.get(object); |
21 | Object copyType = mappingDomain.getOutputTypeClassifier(ownerType); | | | |
22 | if (copyType != null) | | 9 | if (wrapper != null) |
| | | 10 | |
23 | mappingDomain.setTypeClassifier(copy, copyType); | | | |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched statement Object wrapper=childrenMap.get(object); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |