File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java | File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/deployment/ui/AbstractFigNode.java | |||
Method name: void updateListeners(Object, Object)
|
Method name: void updateListeners(Object, Object)
|
|||
Number of AST nodes: 2 | Number of AST nodes: 3 | |||
1 | @Override | 1 | @Override | |
2 | protected void updateListeners(Object oldOwner, Object newOwner) { | 2 | protected void updateListeners(Object oldOwner, Object newOwner) { | |
3 | 3 | Set<Object[]> l = new HashSet<Object[]>(); | ||
4 | Set<Object[]> listeners = new HashSet<Object[]>(); | 4 | if (newOwner != null) { | |
5 | if (newOwner != null) { | 5 | // add the listeners to the newOwner | |
6 | listeners.add(new Object[] {newOwner, null}); | 6 | l.add(new Object[] {newOwner, null}); | |
7 | // register for tagDefinitions: | 7 | ||
8 | for (Object td : Model.getFacade().getTagDefinitions(newOwner)) { | 8 | Collection c = Model.getFacade().getStereotypes(newOwner); | |
9 | listeners.add(new Object[] {td, | 9 | Iterator i = c.iterator(); | |
10 | new String[] {"name", "tagType", "multiplicity"}}); | 10 | while (i.hasNext()) { | |
11 | } | 11 | Object st = i.next(); | |
12 | /* TODO: constraints, ... */ | 12 | l.add(new Object[] {st, "name"}); | |
13 | } | 13 | } | |
14 | updateElementListeners(listeners); | 14 | } | |
15 | } | 15 | updateElementListeners(l); | |
16 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 1.000 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | for (Object td : Model.getFacade().getTagDefinitions(newOwner)) |
| 6 | while (i.hasNext()) | |||||||||||||
5 | listeners.add(new Object[] {td, new String[] {"name", "tagType", "multiplicity"}}); |
| | ||||||||||||||
|
| 7 | Object st = i.next(); | ||||||||||||||
|
| 8 | l.add(new Object[] {st, "name"}); |
Row | Violation |
---|---|
1 | Unmatched statement listeners.add(new Object[]{td,new String[]{"name","tagType","multiplicity"}}); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement l.add(new Object[]{st,"name"}); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |