File path: /ArgoUML-0.34-src/argouml-cpp/src/org/argouml/language/cpp/profile/BaseProfile.java | File path: /ArgoUML-0.34-src/argouml-cpp/src/org/argouml/language/cpp/reveng/ModelerImpl.java | |||
Method name: Object findDataType(String, Object)
|
Method name: Object findClass(String, Object)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 4 | |||
1 | static Object findDataType(String typeName, Object model2) { | 1 | /** | |
2 | Collection dataTypes = getCoreHelper().getAllDataTypes(model2); | 2 | * Find a class within the given namespace that has the given identifier. | |
3 | for (Object dt : dataTypes) { | 3 | * | |
4 | if (getFacade().getName(dt).equals(typeName)) { | 4 | * @param identifier the class identifier | |
5 | return dt; | 5 | * @param ns namespace to look in | |
6 | } | 6 | * @return the class if found, null otherwise | |
7 | } | 7 | */ | |
8 | return null; | 8 | private static Object findClass(String identifier, Object ns) { | |
9 | } | 9 | Collection classes = getCoreHelper().getAllClasses(ns); | |
10 | Iterator it = classes.iterator(); | |||
11 | while (it.hasNext()) { | |||
12 | Object candidateClass = it.next(); | |||
13 | if (Model.getFacade().getName(candidateClass).equals(identifier)) { | |||
14 | return candidateClass; | |||
15 | } | |||
16 | } | |||
17 | return null; | |||
18 | } | |||
See real code fragment | See real code fragment |
Number of mapped statements | 5 |
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.833 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | for (Object dt : dataTypes) |
| 3 | while (it.hasNext()) | ||||||||||||||||
|
| 4 | Object candidateClass = it.next(); | |||||||||||||||||
3 | if (getFacade().getName(dt).equals(typeName)) |
| 5 | if (Model.getFacade().getName(candidateClass).equals(identifier)) | ||||||||||||||||
4 | return dt; |
| 6 | return candidateClass; |
Row | Violation |
---|