File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/notation/providers/EnumerationLiteralNotation.java | File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/notation/providers/NotationUtilityProviders.java | |||
Method name: void initialiseListener(Object)
|
Method name: void addListenersForEvent(NotationProvider, Object)
|
|||
Number of AST nodes: 2 | Number of AST nodes: 3 | |||
1 | @Override | 1 | private static void addListenersForEvent(NotationProvider np, | |
2 | public void initialiseListener(Object modelElement) { | 2 | Object event) { | |
3 | addElementListener(modelElement, | 3 | if (event != null) { | |
4 | new String[] {"name", "remove", "stereotype"} ); | 4 | if (Model.getFacade().isAEvent(event)) { | |
5 | Collection c = Model.getFacade().getStereotypes(modelElement); | 5 | np.addElementListener(event, | |
6 | for (Object st : c) { | 6 | new String[] { | |
7 | addElementListener(st, new String[] {"name", "remove"}); | 7 | "parameter", "name"}); | |
8 | } | 8 | } | |
9 | } | 9 | if (Model.getFacade().isATimeEvent(event)) { | |
10 | np.addElementListener(event, new String[] {"when"}); | |||
11 | } | |||
12 | if (Model.getFacade().isAChangeEvent(event)) { | |||
13 | np.addElementListener(event, | |||
14 | new String[] {"changeExpression"}); | |||
15 | } | |||
16 | /* And the parameter names and values: */ | |||
17 | Collection prms = Model.getFacade().getParameters(event); | |||
18 | Iterator i = prms.iterator(); | |||
19 | while (i.hasNext()) { | |||
20 | Object parameter = i.next(); | |||
21 | np.addElementListener(parameter, | |||
22 | new String[] {"defaultValue", "name", "type", "kind"}); | |||
23 | } | |||
24 | } | |||
25 | } | |||
See real code fragment | See real code fragment |
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 | 0.750 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | for (Object st : c) |
| 10 | while (i.hasNext()) | |||||||||||||||||||
|
| 11 | Object parameter = i.next(); | ||||||||||||||||||||
4 | addElementListener(st, new String[] {"name", "remove"}); |
| 12 | np.addElementListener(parameter, new String[] {"defaultValue", "name", "type", "kind"}); |
Row | Violation |
---|---|
1 | Expression addElementListener(st,new String[]{"name","remove"}) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression addElementListener(st,new String[]{"name","remove"}) is a void method call, and thus it cannot be parameterized |
3 | Expression np.addElementListener(parameter,new String[]{"defaultValue","name","type","kind"}) is a void method call, and thus it cannot be parameterized |