@Override public void initialiseListener(Object modelElement) { addElementListener( modelElement, new String[] {"name", "visibility", "stereotype", "taggedValue"}); Collection stereotypes = Model.getFacade().getStereotypes(modelElement); Iterator iter = stereotypes.iterator(); while (iter.hasNext()) { Object o = iter.next(); addElementListener( o, new String[] {"name", "remove"}); } // We also show tagged values (the / for derived) for (Object uml : Model.getFacade().getTaggedValuesCollection(modelElement)) { addElementListener(uml); } }
@Override public void initialiseListener(Object modelElement) { addElementListener(modelElement); Object cis = Model.getFacade().getType(modelElement); if (Model.getFacade().isAClassifierInState(cis)) { addElementListener(cis, new String[] {"remove", "inState"}); Collection<Object> c = Model.getFacade().getInStates(cis); for (Object state : c) { addElementListener(state, new String[] {"remove", "name"}); } } }
Clone fragments detected by clone detection tool
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/notation/providers/AssociationEndNameNotation.java File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/notation/providers/ObjectFlowStateStateNotation.java
Method name: void initialiseListener(Object) Method name: void initialiseListener(Object)
Number of AST nodes: 3 Number of AST nodes: 2
1
@Override
1
@Override
2
    public void initialiseListener(Object modelElement) {
2
    public void initialiseListener(Object modelElement) {
3
        addElementListener(
3
        addElementListener(modelElement);
4
                modelElement, 
4
        Object cis = Model.getFacade().getType(modelElement);
5
                new String[] {"name", "visibility", "stereotype", "taggedValue"});
5
        if (Model.getFacade().isAClassifierInState(cis)) {
6
        Collection stereotypes =
6
            addElementListener(cis,
7
                Model.getFacade().getStereotypes(modelElement);
7
                    new String[] {"remove", "inState"});
8
        Iterator iter = stereotypes.iterator();
8
            Collection<Object> c = Model.getFacade().getInStates(cis);
9
        while (iter.hasNext()) {
9
            for (Object state : c) {
10
            Object o = iter.next();
10
                addElementListener(state,
11
            addElementListener(
11
                        new String[] {"remove", "name"});
12
                    o, 
12
            }
13
                    new String[] {"name", "remove"});
13
        }
14
        }
14
    }
15
        // We also show tagged values (the / for derived)
16
        for (Object uml : Model.getFacade().getTaggedValuesCollection(modelElement)) {
17
            addElementListener(uml);
18
        }
19
    }
  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
    4
    while (iter.hasNext())
    4
    while (iter.hasNext())
    6
    for (Object state : c)
    Differences
    Expression1Expression2Difference
    ostateVARIABLE_NAME_MISMATCH
    6
    for (Object state : c)
    5
    Object o = iter.next();
    5
    Object o = iter.next();
    Differences
    Expression1Expression2Difference
    ostateVARIABLE_NAME_MISMATCH
                                                    
    6
    addElementListener(o, new String[] {"name", "remove"});
    6
    addElementListener(o, new String[] {"name", "remove"});
    7
    addElementListener(state, new String[] {"remove", "name"});
    Differences
    Expression1Expression2Difference
    ostateVARIABLE_NAME_MISMATCH
    "name""remove"LITERAL_VALUE_MISMATCH
    "remove""name"LITERAL_VALUE_MISMATCH
    7
    addElementListener(state, new String[] {"remove", "name"});
    Precondition Violations (0)
    Row Violation