File path: /ArgoUML-0.34-src/argouml/src/argouml-core-model-euml/src/org/argouml/model/euml/CoreHelperEUMLImpl.java | File path: /ArgoUML-0.34-src/argouml/src/argouml-core-model-mdr/src/org/argouml/model/mdr/ModelManagementHelperMDRImpl.java | |||
Method name: Collection getAllPossibleNamespaces(Object, Object)
|
Method name: Collection getAllPossibleImports(Object)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 4 | |||
1 | public Collection getAllPossibleNamespaces( | 1 | public Collection getAllPossibleImports(Object pack) { | |
2 | Object modelElement, | 2 | // TODO: Fully implement this! | |
3 | Object model) { | 3 | ||
4 | if (!(model instanceof Element) || !(modelElement instanceof Element)) { | 4 | Object container = pack; | |
5 | throw new IllegalArgumentException( | 5 | Object cc = modelImpl.getFacade().getModelElementContainer(pack); | |
6 | "modelElement and model must be instances of Element"); | 6 | while (cc != null) { | |
7 | } | 7 | container = cc; | |
8 | Collection result = new ArrayList(); | 8 | cc = modelImpl.getFacade().getModelElementContainer(cc); | |
9 | if (isValidNamespace(modelElement, model)) { | 9 | } | |
10 | result.add((Namespace) model); | 10 | ||
11 | } | 11 | Collection mes = getAllModelElementsOfKind(container, | |
12 | final ModelManagementHelperEUMLImpl helper = | 12 | modelImpl.getMetaTypes().getModelElement()); | |
13 | modelImpl.getModelManagementHelper(); | 13 | ||
14 | for (Object o | 14 | Collection vmes = new ArrayList(); | |
15 | : helper.getAllModelElementsOfKind(model, Namespace.class)) { | 15 | Iterator i = mes.iterator(); | |
16 | if (isValidNamespace(modelElement, o)) { | 16 | while (i.hasNext()) { | |
17 | result.add((Namespace) o); | 17 | Object me = i.next(); | |
18 | } | 18 | if (modelImpl.getCoreHelper().isValidNamespace(me, pack)) { | |
19 | } | 19 | vmes.add(me); | |
20 | return result; | 20 | } | |
21 | } | 21 | } | |
22 | ||||
23 | return vmes; | |||
24 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 4 |
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.375 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | for (Object o : helper.getAllModelElementsOfKind(model, Namespace.class)) |
| 9 | while (i.hasNext()) | ||||||||||||||||||
|
| 10 | Object me = i.next(); | |||||||||||||||||||
8 | if (isValidNamespace(modelElement, o)) |
| 11 | if (modelImpl.getCoreHelper().isValidNamespace(me, pack)) | ||||||||||||||||||
9 | result.add((Namespace)o); |
| | |||||||||||||||||||
|
| 12 | vmes.add(me); |
Row | Violation |
---|---|
1 | Expression o cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression isValidNamespace(modelElement,o) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement result.add((Namespace)o); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement vmes.add(me); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |