File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/ui/FigAssociationClass.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 | List edges = null; | 9 | } | |
10 | 10 | } | ||
11 | FigEdgePort figEdgePort = getEdgePort(); | 11 | return null; | |
12 | if (figEdgePort != null) { | 12 | } | |
13 | edges = figEdgePort.getFigEdges(); | |||
14 | } | |||
15 | ||||
16 | if (edges != null) { | |||
17 | for (Iterator it = edges.iterator(); it.hasNext() | |||
18 | && figEdgeLink == null;) { | |||
19 | Object o = it.next(); | |||
20 | if (o instanceof FigEdgeAssociationClass) { | |||
21 | figEdgeLink = (FigEdgeAssociationClass) o; | |||
22 | } | |||
23 | } | |||
24 | } | |||
25 | ||||
26 | if (figEdgeLink != null) { | |||
27 | FigNode figClassBox = figEdgeLink.getDestFigNode(); | |||
28 | if (!(figClassBox instanceof FigClassAssociationClass)) { | |||
29 | figClassBox = figEdgeLink.getSourceFigNode(); | |||
30 | } | |||
31 | figEdgeLink.removeFromDiagramImpl(); | |||
32 | ((FigClassAssociationClass) figClassBox).removeFromDiagramImpl(); | |||
33 | } | |||
34 | ||||
35 | super.removeFromDiagramImpl(); | |||
36 | } | |||
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 | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | for (Iterator it = edges.iterator(); it.hasNext() && figEdgeLink == null; ) |
| 1 | for (Object fig : getFigEdges()) | ||||||||||||||||||||
8 | Object o = it.next(); |
| | |||||||||||||||||||||
9 | if (o instanceof FigEdgeAssociationClass) |
| 2 | if (fig instanceof FigEdgeAssociationClass) | ||||||||||||||||||||
10 | 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(); |