@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() { Object own = getOwner(); if (own != null) { getProject().moveToTrash(own); } for (Object fig : getFigs()) { ((Fig) 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/FigNodeModelElement.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
        Object own = getOwner();
4
        if (own != null) {
4
        if (own != null) {
5
            getProject().moveToTrash(own);
5
            getProject().moveToTrash(own);
6
        }
6
        }
7
7
        for (Object fig : getFigs()) {
8
        /* TODO: MVW: Why is this not done in GEF? */
8
            ((Fig) fig).deleteFromModel();
9
        Iterator it = getPathItemFigs().iterator();
9
        }
10
        while (it.hasNext()) {
10
        super.deleteFromModel();
11
            ((Fig) it.next()).deleteFromModel();
11
    }
12
        }
13
        super.deleteFromModel();
14
    }
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score0.667
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    while (it.hasNext())
    5
    while (it.hasNext())
    4
    for (Object fig : getFigs())
    Differences
    Expression1Expression2Difference
    java.util.Vectorjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Vector of variable getPathItemFigs() does not match with type java.util.List<org.tigris.gef.presentation.Fig> of variable getFigs()
    • Make classes java.util.Vector and java.util.List extend a common superclass
    4
    for (Object fig : getFigs())
    6
    ((Fig)it.next()).deleteFromModel();
    6
    ((Fig)it.next()).deleteFromModel();
    5
    ((Fig)fig).deleteFromModel();
    Differences
    Expression1Expression2Difference
    it.next()figTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression fig cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    ((Fig)fig).deleteFromModel();
    Precondition Violations (2)
    Row Violation
    1Type java.util.Vector of variable getPathItemFigs() does not match with type java.util.List<org.tigris.gef.presentation.Fig> of variable getFigs()
    2Expression fig cannot be parameterized, because it has dependencies to/from statements that will be extracted