File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/notation/providers/ObjectNotation.java | File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/notation/providers/ObjectFlowStateStateNotation.java | |||
Method name: void initialiseListener(Object)
|
Method name: void initialiseListener(Object)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 2 | |||
1 | @Override | 1 | @Override | |
2 | public void initialiseListener(Object modelElement) { | 2 | public void initialiseListener(Object modelElement) { | |
3 | addElementListener(modelElement, | 3 | addElementListener(modelElement); | |
4 | new String[] {"name", "classifier"}); | 4 | Object cis = Model.getFacade().getType(modelElement); | |
5 | 5 | if (Model.getFacade().isAClassifierInState(cis)) { | ||
6 | // Add the following once we show stereotypes: | 6 | addElementListener(cis, | |
7 | // Collection c = Model.getFacade().getStereotypes(newOwner); | 7 | new String[] {"remove", "inState"}); | |
8 | // Iterator i = c.iterator(); | 8 | Collection<Object> c = Model.getFacade().getInStates(cis); | |
9 | // while (i.hasNext()) { | 9 | for (Object state : c) { | |
10 | // Object st = i.next(); | 10 | addElementListener(state, | |
11 | // addElementListener(st, "name"); | 11 | new String[] {"remove", "name"}); | |
12 | // } | 12 | } | |
13 | 13 | } | ||
14 | Collection c = Model.getFacade().getClassifiers(modelElement); | 14 | } | |
15 | Iterator i = c.iterator(); | |||
16 | while (i.hasNext()) { | |||
17 | Object st = i.next(); | |||
18 | addElementListener(st, "name"); | |||
19 | } | |||
20 | } | |||
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 | 0.500 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | while (i.hasNext()) |
| 6 | for (Object state : c) | ||||||||||
5 | Object st = i.next(); |
| | |||||||||||
6 | addElementListener(st, "name"); |
| | |||||||||||
|
| 7 | addElementListener(state, new String[] {"remove", "name"}); |
Row | Violation |
---|---|
1 | Unmatched statement addElementListener(st,"name"); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement addElementListener(state,new String[]{"remove","name"}); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |