public void deleteCollection(Collection col) {
Iterator it = col.iterator();
while (it.hasNext()) {
modelImpl.getUmlFactory().delete(it.next());
}
}
/**
* @param elem
* the associationrole
*/
public void deleteAssociationRole(Object elem) {
AssociationRole role = (AssociationRole) elem;
for (Message message : role.getMessage()) {
modelImpl.getUmlFactory().delete(message);
Clone fragments detected by clone detection tool
File path: /ArgoUML-0.34-src/argouml/src/argouml-core-model-mdr/src/org/argouml/model/mdr/UmlHelperMDRImpl.java
|
|
File path: /ArgoUML-0.34-src/argouml/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CollaborationsFactoryMDRImpl.java
|
Method name: void deleteCollection(Collection)
|
|
Method name: void deleteAssociationRole(Object)
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | public void deleteCollection(Collection col) { | | 1 | /** |
2 | Iterator it = col.iterator(); | | 2 | * @param elem |
3 | while (it.hasNext()) { | | 3 | * the associationrole |
4 | modelImpl.getUmlFactory().delete(it.next()); | | 4 | */ |
5 | } | | 5 | public void deleteAssociationRole(Object elem) { |
6 | } | | 6 | AssociationRole role = (AssociationRole) elem; |
| | | 7 | for (Message message : role.getMessage()) { |
| | | 8 | modelImpl.getUmlFactory().delete(message); |
| | | 9 | |
See real code fragment |
|
See real code fragment |
-
{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.0 |
Similarity Score | 0.750 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
2 | while (it.hasNext()) | | 2 | for (Message message : role.getMessage()) |
| | | 3 | modelImpl.getUmlFactory().delete(message); |
3 | modelImpl.getUmlFactory().delete(it.next()); | | | |
Precondition Violations (3)
Row |
Violation |
1 | Type java.util.Collection of variable col does not match with type java.util.Collection<org.omg.uml.behavioralelements.collaborations.Message> of variable role.getMessage() |
2 | Unmatched statement modelImpl.getUmlFactory().delete(message); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables message |