@Override
public void deleteFromModel() {
Object own = getOwner();
if (own != null) {
getProject().moveToTrash(own);
}
/* TODO: MVW: Why is this not done in GEF? */
Iterator it = getPathItemFigs().iterator();
while (it.hasNext()) {
((Fig) it.next()).deleteFromModel();
}
super.deleteFromModel();
}
@Override
public void deleteFromModel() {
for (Fig fig : getFigs()) {
fig.deleteFromModel();
}
super.deleteFromModel();
}
Clone fragments detected by clone detection tool
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
|
|
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/ui/FigTextGroup.java
|
Method name: void deleteFromModel()
|
|
Method name: void deleteFromModel()
|
Number of AST nodes: 2
|
|
Number of AST nodes: 2
|
|
1 | @Override | | 1 | @Override |
2 | public void deleteFromModel() { | | 2 | public void deleteFromModel() { |
3 | Object own = getOwner(); | | 3 | for (Fig fig : getFigs()) { |
4 | if (own != null) { | | 4 | fig.deleteFromModel(); |
5 | getProject().moveToTrash(own); | | 5 | } |
6 | } | | 6 | super.deleteFromModel(); |
7 | | | 7 | } |
8 | /* TODO: MVW: Why is this not done in GEF? */ | | | |
9 | Iterator it = getPathItemFigs().iterator(); | | | |
10 | while (it.hasNext()) { | | | |
11 | ((Fig) it.next()).deleteFromModel(); | | | |
12 | } | | | |
13 | super.deleteFromModel(); | | | |
14 | } | | | |
See real code fragment |
|
See real code fragment |
-
{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.0 |
Similarity Score | 1.000 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
5 | while (it.hasNext()) | | 1 | for (Fig fig : getFigs()) |
6 | ((Fig)it.next()).deleteFromModel(); | | 2 | |
Precondition Violations (2)
Row |
Violation |
1 | Type java.util.Vector of variable getPathItemFigs() does not match with type java.util.List<org.tigris.gef.presentation.Fig> of variable getFigs() |
2 | Expression fig cannot be parameterized, because it has dependencies to/from statements that will be extracted |