@Override protected void updateListeners(Object oldOwner, Object newOwner) { super.updateListeners(oldOwner, newOwner); if (newOwner != null) { Collection c = Model.getFacade().getStereotypes(newOwner); Iterator i = c.iterator(); while (i.hasNext()) { Object st = i.next(); addElementListener(st, "name"); } } }
@Override protected void updateListeners(Object oldOwner, Object newOwner) { super.updateListeners(oldOwner, newOwner); if (newOwner != null) { for (Object classifier : Model.getFacade().getClassifiers(newOwner)) { addElementListener(classifier, "name"); } } }
Clone fragments detected by clone detection tool
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/AbstractFigComponent.java File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/FigComponentInstance.java
Method name: void updateListeners(Object, Object) Method name: void updateListeners(Object, Object)
Number of AST nodes: 3 Number of AST nodes: 2
1
@Override
1
@Override
2
    protected void updateListeners(Object oldOwner, Object newOwner) {
2
    protected void updateListeners(Object oldOwner, Object newOwner) {
3
        super.updateListeners(oldOwner, newOwner);
3
        super.updateListeners(oldOwner, newOwner);
4
        if (newOwner != null) {
4
        if (newOwner != null) {
5
            Collection c = Model.getFacade().getStereotypes(newOwner);
5
            for (Object classifier 
6
            Iterator i = c.iterator();
6
                    : Model.getFacade().getClassifiers(newOwner)) {
7
            while (i.hasNext()) {
7
                addElementListener(classifier, "name");
8
                Object st = i.next();
8
            }
9
                addElementListener(st, "name");
9
        }
10
            }
10
    }
11
        }
12
    }
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    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 Score1.000
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    while (i.hasNext())
    5
    while (i.hasNext())
    3
    for (Object classifier : Model.getFacade().getClassifiers(newOwner))
    Differences
    Expression1Expression2Difference
    stclassifierVARIABLE_NAME_MISMATCH
    cModel.getFacade().getClassifiers(newOwner)TYPE_COMPATIBLE_REPLACEMENT
    3
    for (Object classifier : Model.getFacade().getClassifiers(newOwner))
    6
    Object st = i.next();
    6
    Object st = i.next();
    Differences
    Expression1Expression2Difference
    stclassifierVARIABLE_NAME_MISMATCH
                                                
    7
    addElementListener(st, "name");
    7
    addElementListener(st, "name");
    4
    addElementListener(classifier, "name");
    Differences
    Expression1Expression2Difference
    stclassifierVARIABLE_NAME_MISMATCH
    4
    addElementListener(classifier, "name");
    Precondition Violations (0)
    Row Violation