File path: /ArgoUML-0.34-src/argouml/src/argouml-core-model-mdr/src/org/argouml/model/mdr/CoreHelperMDRImpl.java | File path: /ArgoUML-0.34-src/argouml/src/argouml-core-model-mdr/src/org/argouml/model/mdr/FacadeMDRImpl.java | |||
Method name: AssociationEnd getAssociationEnd(Object, Object)
|
Method name: Object getAssociationEnd(Object, Object)
|
|||
Number of AST nodes: 3 | Number of AST nodes: 4 | |||
1 | public AssociationEnd getAssociationEnd(Object type, Object assoc) { | 1 | public Object getAssociationEnd(Object handle, Object assoc) { | |
2 | if (!(type instanceof Classifier)) { | 2 | try { | |
3 | throw new IllegalArgumentException(); | 3 | if (handle instanceof Classifier | |
4 | } | 4 | && assoc instanceof UmlAssociation) { | |
5 | if (!(assoc instanceof UmlAssociation)) { | 5 | Classifier classifier = (Classifier) handle; | |
6 | throw new IllegalArgumentException(); | 6 | Iterator it = getAssociationEnds(classifier).iterator(); | |
7 | } | 7 | while (it.hasNext()) { | |
8 | try { | 8 | AssociationEnd end = (AssociationEnd) it.next(); | |
9 | for (AssociationEnd end : (Collection<AssociationEnd>) Model | 9 | if (((UmlAssociation) assoc).getConnection() | |
10 | .getFacade().getAssociationEnds(type)) { | 10 | .contains(end)) { | |
11 | if (((UmlAssociation) assoc).getConnection().contains(end)) { | 11 | return end; | |
12 | return end; | 12 | } | |
13 | } | 13 | } | |
14 | } | 14 | return null; | |
15 | } catch (InvalidObjectException e) { | 15 | } | |
16 | throw new InvalidElementException(e); | 16 | throw new IllegalArgumentException("handle: " + handle + ",assoc: " | |
17 | } | 17 | + assoc); | |
18 | return null; | 18 | } catch (InvalidObjectException e) { | |
19 | } | 19 | throw new InvalidElementException(e); | |
20 | } | |||
21 | } | |||
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 | 1.000 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | for (AssociationEnd end : (Collection<AssociationEnd>)Model.getFacade().getAssociationEnds(type)) |
| 5 | while (it.hasNext()) | |||||||||||
| 6 | AssociationEnd end = (AssociationEnd)it.next(); | |||||||||||||
7 | if (((UmlAssociation)assoc).getConnection().contains(end)) | 7 | if (((UmlAssociation)assoc).getConnection().contains(end)) | ||||||||||||
8 | return end; | 8 | return end; |
Row | Violation |
---|---|
1 | Type java.util.Collection<org.omg.uml.foundation.core.AssociationEnd> of variable (Collection<AssociationEnd>)Model.getFacade().getAssociationEnds(type) does not match with type java.util.Collection of variable getAssociationEnds(classifier) |