File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeAssociation.java | File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/ui/FigClassAssociationClass.java | |||
Method name: void removeFromDiagramImpl()
|
Method name: Fig getRemoveDelegate()
|
|||
Number of AST nodes: 4 | Number of AST nodes: 4 | |||
1 | /** | 1 | protected Fig getRemoveDelegate() { | |
2 | * Remove entire composite Fig from Diagram. Discover the attached | 2 | // Look for the dashed edge | |
3 | * FigEdgeAssociationClass and the FigClassAssociationClass attached to | 3 | for (Object fig : getFigEdges()) { | |
4 | * that. Remove them from the diagram before removing this. | 4 | if (fig instanceof FigEdgeAssociationClass) { | |
5 | */ | 5 | // We have the dashed edge now find the opposite FigNode | |
6 | @Override | 6 | FigEdgeAssociationClass dashedEdge = | |
7 | protected void removeFromDiagramImpl() { | 7 | (FigEdgeAssociationClass) fig; | |
8 | FigEdgeAssociationClass figEdgeLink = null; | 8 | return dashedEdge.getRemoveDelegate(); | |
9 | final List edges = getFigEdges(); | 9 | } | |
10 | 10 | } | ||
11 | if (edges != null) { | 11 | return null; | |
12 | for (Iterator it = edges.iterator(); it.hasNext() | 12 | } | |
13 | && figEdgeLink == null;) { | |||
14 | Object o = it.next(); | |||
15 | if (o instanceof FigEdgeAssociationClass) { | |||
16 | figEdgeLink = (FigEdgeAssociationClass) o; | |||
17 | } | |||
18 | } | |||
19 | } | |||
20 | ||||
21 | if (figEdgeLink != null) { | |||
22 | FigNode figClassBox = figEdgeLink.getDestFigNode(); | |||
23 | if (!(figClassBox instanceof FigClassAssociationClass)) { | |||
24 | figClassBox = figEdgeLink.getSourceFigNode(); | |||
25 | } | |||
26 | figEdgeLink.removeFromDiagramImpl(); | |||
27 | ((FigClassAssociationClass) figClassBox).removeFromDiagramImpl(); | |||
28 | } | |||
29 | ||||
30 | super.removeFromDiagramImpl(); | |||
31 | } | |||
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 | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Similarity Score | 0.667 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4 | for (Iterator it = edges.iterator(); it.hasNext() && figEdgeLink == null; ) |
| 1 | for (Object fig : getFigEdges()) | ||||||||||||||||||||
5 | Object o = it.next(); |
| | |||||||||||||||||||||
6 | if (o instanceof FigEdgeAssociationClass) |
| 2 | if (fig instanceof FigEdgeAssociationClass) | ||||||||||||||||||||
7 | figEdgeLink = (FigEdgeAssociationClass)o; |
| 3 | FigEdgeAssociationClass dashedEdge = (FigEdgeAssociationClass)fig; | ||||||||||||||||||||
|
| 4 | return dashedEdge.getRemoveDelegate(); |
Row | Violation |
---|---|
1 | Type java.util.List of variable edges does not match with type java.util.List<org.tigris.gef.presentation.FigEdge> of variable getFigEdges() |
2 | Expression figEdgeLink cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression dashedEdge cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression figEdgeLink cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression dashedEdge cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement return dashedEdge.getRemoveDelegate(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Unmatched return dashedEdge.getRemoveDelegate(); |