@Override
public void removeFromDiagram() {
for (Fig fig : getFigs()) {
fig.removeFromDiagram();
}
super.removeFromDiagram();
}
protected void removeFromDiagramImpl() {
Object o = getOwner();
if (o != null) {
removeElementListener(o);
}
if (notationProviderName != null) {
notationProviderName.cleanListener();
}
/* TODO: MVW: Why is this not done in GEF? */
Iterator it = getPathItemFigs().iterator();
while (it.hasNext()) {
Fig fig = (Fig) it.next();
fig.removeFromDiagram();
}
super.removeFromDiagram();
damage();
}
Clone fragments detected by clone detection tool
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/ui/FigTextGroup.java
|
|
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/ui/FigEdgeModelElement.java
|
Method name: void removeFromDiagram()
|
|
Method name: void removeFromDiagramImpl()
|
Number of AST nodes: 2
|
|
Number of AST nodes: 3
|
|
1 | @Override | | 1 | protected void removeFromDiagramImpl() { |
2 | public void removeFromDiagram() { | | 2 | Object o = getOwner(); |
3 | for (Fig fig : getFigs()) { | | 3 | if (o != null) { |
4 | fig.removeFromDiagram(); | | 4 | removeElementListener(o); |
5 | } | | 5 | } |
6 | super.removeFromDiagram(); | | 6 | if (notationProviderName != null) { |
7 | } | | 7 | notationProviderName.cleanListener(); |
| | | 8 | } |
| | | 9 | |
| | | 10 | /* TODO: MVW: Why is this not done in GEF? */ |
| | | 11 | Iterator it = getPathItemFigs().iterator(); |
| | | 12 | while (it.hasNext()) { |
| | | 13 | Fig fig = (Fig) it.next(); |
| | | 14 | fig.removeFromDiagram(); |
| | | 15 | } |
| | | 16 | |
| | | 17 | super.removeFromDiagram(); |
| | | 18 | damage(); |
| | | 19 | } |
See real code fragment |
|
See real code fragment |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 4 |
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 |
1 | for (Fig fig : getFigs()) | | 7 | while (it.hasNext()) |
| | | 8 | Fig fig = (Fig)it.next(); |
2 | | | 9 | |
Precondition Violations (1)
Row |
Violation |
1 | Type java.util.List<org.tigris.gef.presentation.Fig> of variable getFigs() does not match with type java.util.Vector of variable getPathItemFigs() |