File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.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 | Set<Object[]> listeners = new HashSet<Object[]>(); | 3 | Set<Object[]> l = new HashSet<Object[]>(); | |
4 | /* Let's register for events from all modelelements | 4 | if (newOwner != null) { | |
5 | * that change the name or body text: | 5 | // add the listeners to the newOwner | |
6 | */ | 6 | l.add(new Object[] {newOwner, null}); | |
7 | if (newOwner != null) { | 7 | ||
8 | /* Register for name changes, added extensionPoints | 8 | Collection c = Model.getFacade().getStereotypes(newOwner); | |
9 | * and abstract makes the text italic. | 9 | Iterator i = c.iterator(); | |
10 | * All Figs need to listen to "remove", too: */ | 10 | while (i.hasNext()) { | |
11 | listeners.add(new Object[] {newOwner, | 11 | Object st = i.next(); | |
12 | new String[] {"remove", "name", "isAbstract", | 12 | l.add(new Object[] {st, "name"}); | |
13 | "extensionPoint", "stereotype"}}); | 13 | } | |
14 | 14 | } | ||
15 | // register for extension points: | 15 | updateElementListeners(l); | |
16 | for (Object ep : Model.getFacade().getExtensionPoints(newOwner)) { | 16 | } | |
17 | listeners.add(new Object[] {ep, new String[] {"location", "name"}}); | |||
18 | } | |||
19 | ||||
20 | for (Object st : Model.getFacade().getStereotypes(newOwner)) { | |||
21 | listeners.add(new Object[] {st, "name"}); | |||
22 | } | |||
23 | } | |||
24 | updateElementListeners(listeners); | |||
25 | } | |||
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 ep : Model.getFacade().getExtensionPoints(newOwner)) |
| 6 | while (i.hasNext()) | |||||||||||||
5 | listeners.add(new Object[] {ep, new String[] {"location", "name"}}); |
| | ||||||||||||||
|
| 7 | Object st = i.next(); | ||||||||||||||
|
| 8 | l.add(new Object[] {st, "name"}); |
Row | Violation |
---|---|
1 | Unmatched statement listeners.add(new Object[]{ep,new String[]{"location","name"}}); 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 |