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