File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/kernel/ProfileConfiguration.java | File path: /ArgoUML-0.34-src/argouml/src/argouml-core-umlpropertypanels/src/org/argouml/core/propertypanels/ui/UMLStateMachineContextComboBoxModel.java | |||
Method name: Collection findByMetaType(Object)
|
Method name: void buildModelList()
|
|||
Number of AST nodes: 3 | Number of AST nodes: 3 | |||
1 | /** | 1 | protected void buildModelList() { | |
2 | * Find all the model elements in the configured {@link Profile}s | 2 | Collection elements = new ArrayList(); | |
3 | * of the given meta type. | 3 | Project p = ProjectManager.getManager().getCurrentProject(); | |
4 | * | 4 | for (Object model : p.getUserDefinedModelList()) { | |
5 | * @param metaType the meta type of the model elements to find | 5 | elements.addAll(Model | |
6 | * @return a {@link Collection} containing the model elements that | 6 | .getModelManagementHelper().getAllModelElementsOfKind( | |
7 | * are of the given meta type | 7 | model, Model.getMetaTypes().getClassifier())); | |
8 | */ | 8 | elements.addAll(Model | |
9 | @SuppressWarnings("unchecked") | 9 | .getModelManagementHelper().getAllModelElementsOfKind( | |
10 | public Collection findByMetaType(Object metaType) { | 10 | model, | |
11 | Set elements = new HashSet(); | 11 | Model.getMetaTypes().getBehavioralFeature())); | |
12 | 12 | } | ||
13 | Iterator it = getProfileModels().iterator(); | 13 | ||
14 | while (it.hasNext()) { | 14 | setElements(elements); | |
15 | Object model = it.next(); | 15 | } | |
16 | elements.addAll(Model.getModelManagementHelper() | |||
17 | .getAllModelElementsOfKind(model, metaType)); | |||
18 | } | |||
19 | return elements; | |||
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 | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 0.667 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | while (it.hasNext()) |
| 3 | for (Object model : p.getUserDefinedModelList()) | |||||||||||||
|
| 4 | elements.addAll(Model.getModelManagementHelper().getAllModelElementsOfKind(model, Model.getMetaTypes().getClassifier())); | ||||||||||||||
4 | Object model = it.next(); | | |||||||||||||||
|
| 5 | elements.addAll(Model.getModelManagementHelper().getAllModelElementsOfKind(model, Model.getMetaTypes().getBehavioralFeature())); | ||||||||||||||
5 | elements.addAll(Model.getModelManagementHelper().getAllModelElementsOfKind(model, metaType)); |
| |
Row | Violation |
---|---|
1 | Unmatched statement elements.addAll(Model.getModelManagementHelper().getAllModelElementsOfKind(model,Model.getMetaTypes().getClassifier())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement elements.addAll(Model.getModelManagementHelper().getAllModelElementsOfKind(model,Model.getMetaTypes().getBehavioralFeature())); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement elements.addAll(Model.getModelManagementHelper().getAllModelElementsOfKind(model,metaType)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |