if (style.equals(PieLabelLinkStyle.STANDARD)) { g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY)); g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY)); g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY)); } else if (style.equals(PieLabelLinkStyle.QUAD_CURVE)) { QuadCurve2D q = new QuadCurve2D.Float(); q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY); g2.draw(q); g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY)); } else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) { CubicCurve2D c = new CubicCurve2D .Float(); c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, linkX, linkY); g2.draw(c); }
if (style.equals(PieLabelLinkStyle.STANDARD)) { g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY)); g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY)); g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY)); } else if (style.equals(PieLabelLinkStyle.QUAD_CURVE)) { QuadCurve2D q = new QuadCurve2D.Float(); q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY); g2.draw(q); g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY)); } else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) { CubicCurve2D c = new CubicCurve2D .Float(); c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, linkX, linkY); g2.draw(c); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot.java
Method name: void drawLeftLabel(Graphics2D, PiePlotState, PieLabelRecord) Method name: void drawRightLabel(Graphics2D, PiePlotState, PieLabelRecord)
Number of AST nodes: 13 Number of AST nodes: 13
1
if (style.equals(PieLabelLinkStyle.STANDARD)) {
1
if (style.equals(PieLabelLinkStyle.STANDARD)) {
2
                g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY));
2
                g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY));
3
                g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY));
3
                g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY));
4
                g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY));
4
                g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY));
5
            }
5
            }
6
            else if (style.equals(PieLabelLinkStyle.QUAD_CURVE)) {
6
            else if (style.equals(PieLabelLinkStyle.QUAD_CURVE)) {
7
                QuadCurve2D q = new QuadCurve2D.Float();
7
                QuadCurve2D q = new QuadCurve2D.Float();
8
                q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);
8
                q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);
9
                g2.draw(q);
9
                g2.draw(q);
10
                g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY));               
10
                g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY));               
11
            }
11
            }
12
            else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) {
12
            else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE)) {
13
                CubicCurve2D c = new CubicCurve2D .Float();
13
                CubicCurve2D c = new CubicCurve2D .Float();
14
                c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, 
14
                c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, 
15
                        linkX, linkY);
15
                        linkX, linkY);
16
                g2.draw(c);
16
                g2.draw(c);
17
            }
17
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)1.1
Clones locationClones are declared in the same class
Number of node comparisons117
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)36.4
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    14
    if (style.equals(PieLabelLinkStyle.STANDARD))
    14
    if (style.equals(PieLabelLinkStyle.STANDARD))
    15
    g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY));
    15
    g2.draw(new Line2D.Double(linkX, linkY, elbowX, elbowY));
    16
    g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY));
    16
    g2.draw(new Line2D.Double(anchorX, anchorY, elbowX, elbowY));
    17
    g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY));
    17
    g2.draw(new Line2D.Double(anchorX, anchorY, targetX, targetY));
    18
    else if (style.equals(PieLabelLinkStyle.QUAD_CURVE))
    18
    else if (style.equals(PieLabelLinkStyle.QUAD_CURVE))
    19
    QuadCurve2D q = new QuadCurve2D.Float();
    19
    QuadCurve2D q = new QuadCurve2D.Float();
    20
    q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);
    20
    q.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY);
    21
    g2.draw(q);
    21
    g2.draw(q);
    22
    g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY));
    22
    g2.draw(new Line2D.Double(elbowX, elbowY, linkX, linkY));
    23
    else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE))
    23
    else if (style.equals(PieLabelLinkStyle.CUBIC_CURVE))
    24
    CubicCurve2D c = new CubicCurve2D.Float();
    24
    CubicCurve2D c = new CubicCurve2D.Float();
    25
    c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, linkX, linkY);
    25
    c.setCurve(targetX, targetY, anchorX, anchorY, elbowX, elbowY, linkX, linkY);
    26
    g2.draw(c);
    26
    g2.draw(c);
    Precondition Violations (0)
    Row Violation