@Override
public void initialiseListener(Object modelElement) {
super.initialiseListener(modelElement);
Collection classifiers = Model.getFacade().getBases(modelElement);
for (Object c : classifiers) {
addElementListener(c, "name");
}
}
@Override
public void initialiseListener(Object modelElement) {
addElementListener(modelElement,
new String[] {"entry", "remove", "stereotype"} );
Object entry = Model.getFacade().getEntry(modelElement);
if (entry != null) {
addElementListener(entry, "script");
}
Collection c = Model.getFacade().getStereotypes(modelElement);
Iterator i = c.iterator();
while (i.hasNext()) {
Object st = i.next();
addElementListener(st, "name");
}
}
Clone fragments detected by clone detection tool
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/notation/providers/ClassifierRoleNotation.java
|
|
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/notation/providers/ActionStateNotation.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 | super.initialiseListener(modelElement); | | 3 | addElementListener(modelElement, |
4 | Collection classifiers = Model.getFacade().getBases(modelElement); | | 4 | new String[] {"entry", "remove", "stereotype"} ); |
5 | for (Object c : classifiers) { | | 5 | Object entry = Model.getFacade().getEntry(modelElement); |
6 | addElementListener(c, "name"); | | 6 | if (entry != null) { |
7 | } | | 7 | addElementListener(entry, "script"); |
8 | } | | 8 | } |
| | | 9 | Collection c = Model.getFacade().getStereotypes(modelElement); |
| | | 10 | Iterator i = c.iterator(); |
| | | 11 | while (i.hasNext()) { |
| | | 12 | Object st = i.next(); |
| | | 13 | addElementListener(st, "name"); |
| | | 14 | } |
| | | 15 | } |
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 c : classifiers) | | 7 | while (i.hasNext()) |
| | | 8 | |
4 | addElementListener(c, "name"); | | 9 | addElementListener(st, "name"); |
Precondition Violations (0)
Row |
Violation |