float x0 = (float) dataArea.getX(); float x1 = x0 + (float) Math.abs(this.xOffset); float x3 = (float) dataArea.getMaxX(); float x2 = x3 - (float) Math.abs(this.xOffset); float y0 = (float) dataArea.getMaxY(); float y1 = y0 - (float) Math.abs(this.yOffset); float y3 = (float) dataArea.getMinY(); float y2 = y3 + (float) Math.abs(this.yOffset); GeneralPath clip = new GeneralPath(); clip.moveTo(x0, y0); clip.lineTo(x0, y2); clip.lineTo(x1, y3); clip.lineTo(x3, y3); clip.lineTo(x3, y1); clip.lineTo(x2, y0); clip.closePath(); // put an outline around the data area... Stroke outlineStroke = plot.getOutlineStroke(); Paint outlinePaint = plot.getOutlinePaint(); if ((outlineStroke != null) && (outlinePaint != null)) { g2.setStroke(outlineStroke); g2.setPaint(outlinePaint); g2.draw(clip); }
float x0 = (float) dataArea.getX(); float x1 = x0 + (float) Math.abs(this.xOffset); float x3 = (float) dataArea.getMaxX(); float x2 = x3 - (float) Math.abs(this.xOffset); float y0 = (float) dataArea.getMaxY(); float y1 = y0 - (float) Math.abs(this.yOffset); float y3 = (float) dataArea.getMinY(); float y2 = y3 + (float) Math.abs(this.yOffset); GeneralPath clip = new GeneralPath(); clip.moveTo(x0, y0); clip.lineTo(x0, y2); clip.lineTo(x1, y3); clip.lineTo(x3, y3); clip.lineTo(x3, y1); clip.lineTo(x2, y0); clip.closePath(); // put an outline around the data area... Stroke outlineStroke = plot.getOutlineStroke(); Paint outlinePaint = plot.getOutlinePaint(); if ((outlineStroke != null) && (outlinePaint != null)) { g2.setStroke(outlineStroke); g2.setPaint(outlinePaint); g2.draw(clip); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BarRenderer3D.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LineRenderer3D.java
Method name: void drawOutline(Graphics2D, CategoryPlot, Rectangle2D) Method name: void drawOutline(Graphics2D, CategoryPlot, Rectangle2D)
Number of AST nodes: 22 Number of AST nodes: 22
1
float x0 = (float) dataArea.getX();
1
float x0 = (float) dataArea.getX();
2
        float x1 = x0 + (float) Math.abs(this.xOffset);
2
        float x1 = x0 + (float) Math.abs(this.xOffset);
3
        float x3 = (float) dataArea.getMaxX();
3
        float x3 = (float) dataArea.getMaxX();
4
        float x2 = x3 - (float) Math.abs(this.xOffset);
4
        float x2 = x3 - (float) Math.abs(this.xOffset);
5
        float y0 = (float) dataArea.getMaxY();
5
        float y0 = (float) dataArea.getMaxY();
6
        float y1 = y0 - (float) Math.abs(this.yOffset);
6
        float y1 = y0 - (float) Math.abs(this.yOffset);
7
        float y3 = (float) dataArea.getMinY();
7
        float y3 = (float) dataArea.getMinY();
8
        float y2 = y3 + (float) Math.abs(this.yOffset);
8
        float y2 = y3 + (float) Math.abs(this.yOffset);
9
        GeneralPath clip = new GeneralPath();
9
        GeneralPath clip = new GeneralPath();
10
        clip.moveTo(x0, y0);
10
        clip.moveTo(x0, y0);
11
        clip.lineTo(x0, y2);
11
        clip.lineTo(x0, y2);
12
        clip.lineTo(x1, y3);
12
        clip.lineTo(x1, y3);
13
        clip.lineTo(x3, y3);
13
        clip.lineTo(x3, y3);
14
        clip.lineTo(x3, y1);
14
        clip.lineTo(x3, y1);
15
        clip.lineTo(x2, y0);
15
        clip.lineTo(x2, y0);
16
        clip.closePath();
16
        clip.closePath();
17
        // put an outline around the data area...
17
        // put an outline around the data area...
18
        Stroke outlineStroke = plot.getOutlineStroke();
18
        Stroke outlineStroke = plot.getOutlineStroke();
19
        Paint outlinePaint = plot.getOutlinePaint();
19
        Paint outlinePaint = plot.getOutlinePaint();
20
        if ((outlineStroke != null) && (outlinePaint != null)) {
20
        if ((outlineStroke != null) && (outlinePaint != null)) {
21
            g2.setStroke(outlineStroke);
21
            g2.setStroke(outlineStroke);
22
            g2.setPaint(outlinePaint);
22
            g2.setPaint(outlinePaint);
23
            g2.draw(clip);
23
            g2.draw(clip);
24
        }
24
        }
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)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons180
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements22
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)41.5
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    float x0 = (float)dataArea.getX();
    1
    float x0 = (float)dataArea.getX();
    2
    float x1 = x0 + (float)Math.abs(this.xOffset);
    2
    float x1 = x0 + (float)Math.abs(this.xOffset);
    3
    float x3 = (float)dataArea.getMaxX();
    3
    float x3 = (float)dataArea.getMaxX();
    4
    float x2 = x3 - (float)Math.abs(this.xOffset);
    4
    float x2 = x3 - (float)Math.abs(this.xOffset);
    5
    float y0 = (float)dataArea.getMaxY();
    5
    float y0 = (float)dataArea.getMaxY();
    6
    float y1 = y0 - (float)Math.abs(this.yOffset);
    6
    float y1 = y0 - (float)Math.abs(this.yOffset);
    7
    float y3 = (float)dataArea.getMinY();
    7
    float y3 = (float)dataArea.getMinY();
    8
    float y2 = y3 + (float)Math.abs(this.yOffset);
    8
    float y2 = y3 + (float)Math.abs(this.yOffset);
    9
    GeneralPath clip = new GeneralPath();
    9
    GeneralPath clip = new GeneralPath();
    10
    clip.moveTo(x0, y0);
    10
    clip.moveTo(x0, y0);
    11
    clip.lineTo(x0, y2);
    11
    clip.lineTo(x0, y2);
    12
    clip.lineTo(x1, y3);
    12
    clip.lineTo(x1, y3);
    13
    clip.lineTo(x3, y3);
    13
    clip.lineTo(x3, y3);
    14
    clip.lineTo(x3, y1);
    14
    clip.lineTo(x3, y1);
    15
    clip.lineTo(x2, y0);
    15
    clip.lineTo(x2, y0);
    16
    clip.closePath();
    16
    clip.closePath();
    17
    Stroke outlineStroke = plot.getOutlineStroke();
    17
    Stroke outlineStroke = plot.getOutlineStroke();
    18
    Paint outlinePaint = plot.getOutlinePaint();
    18
    Paint outlinePaint = plot.getOutlinePaint();
    19
    if ((outlineStroke != null) && (outlinePaint != null))
    19
    if ((outlineStroke != null) && (outlinePaint != null))
    20
    g2.setStroke(outlineStroke);
    20
    g2.setStroke(outlineStroke);
    21
    g2.setPaint(outlinePaint);
    21
    g2.setPaint(outlinePaint);
    22
    g2.draw(clip);
    22
    g2.draw(clip);
    Precondition Violations (0)
    Row Violation