if (b_minuendDone && (l_x3 < l_x2) && (l_x2 < l_x4)) { // project onto subtrahend double l_slope = (l_y4 - l_y3) / (l_x4 - l_x3); l_subtrahendNextX = l_minuendNextX; l_subtrahendNextY = new Double((l_slope * l_x2) + (l_y3 - (l_slope * l_x3))); }
if (b_subtrahendDone && (l_x1 < l_x4) && (l_x4 < l_x2)) { // project onto minuend double l_slope = (l_y2 - l_y1) / (l_x2 - l_x1); l_minuendNextX = l_subtrahendNextX; l_minuendNextY = new Double((l_slope * l_x4) + (l_y1 - (l_slope * l_x1))); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYDifferenceRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYDifferenceRenderer.java
Method name: void drawItemPass0(Graphics2D, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState) Method name: void drawItemPass0(Graphics2D, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (b_minuendDone && (l_x3 < l_x2) && (l_x2 < l_x4)) {
1
if (b_subtrahendDone && (l_x1 < l_x4) && (l_x4 < l_x2)) {
2
            // project onto subtrahend
2
            // project onto minuend
3
            double l_slope    = (l_y4 - l_y3) / (l_x4 - l_x3);
3
            double l_slope = (l_y2 - l_y1) / (l_x2 - l_x1);
4
            l_subtrahendNextX = l_minuendNextX;
4
            l_minuendNextX = l_subtrahendNextX;
5
            l_subtrahendNextY = new Double((l_slope * l_x2) 
5
            l_minuendNextY = new Double((l_slope * l_x4) 
6
                    + (l_y3 - (l_slope * l_x3)));
6
                    + (l_y1 - (l_slope * l_x1)));
7
        }
7
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)31.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    214
    if (b_minuendDone && (l_x3 < l_x2) && (l_x2 < l_x4))
    214
    if (b_minuendDone && (l_x3 < l_x2) && (l_x2 < l_x4))
    218
    if (b_subtrahendDone && (l_x1 < l_x4) && (l_x4 < l_x2))
    Differences
    Expression1Expression2Difference
    l_x2l_x4VARIABLE_NAME_MISMATCH
    l_x4l_x2VARIABLE_NAME_MISMATCH
    b_minuendDoneb_subtrahendDoneVARIABLE_NAME_MISMATCH
    l_x3l_x1VARIABLE_NAME_MISMATCH
    l_x2l_x4VARIABLE_NAME_MISMATCH
    218
    if (b_subtrahendDone && (l_x1 < l_x4) && (l_x4 < l_x2))
    215
    double l_slope = (l_y4 - l_y3) / (l_x4 - l_x3);
    215
    double l_slope = (l_y4 - l_y3) / (l_x4 - l_x3);
    219
    double l_slope = (l_y2 - l_y1) / (l_x2 - l_x1);
    Differences
    Expression1Expression2Difference
    l_y4l_y2VARIABLE_NAME_MISMATCH
    l_y3l_y1VARIABLE_NAME_MISMATCH
    l_x4l_x2VARIABLE_NAME_MISMATCH
    l_x3l_x1VARIABLE_NAME_MISMATCH
    219
    double l_slope = (l_y2 - l_y1) / (l_x2 - l_x1);
    216
    l_subtrahendNextX = l_minuendNextX;
    216
    l_subtrahendNextX = l_minuendNextX;
    220
    l_minuendNextX = l_subtrahendNextX;
    Differences
    Expression1Expression2Difference
    l_subtrahendNextXl_minuendNextXVARIABLE_NAME_MISMATCH
    l_minuendNextXl_subtrahendNextXVARIABLE_NAME_MISMATCH
    220
    l_minuendNextX = l_subtrahendNextX;
    217
    l_subtrahendNextY = new Double((l_slope * l_x2) + (l_y3 - (l_slope * l_x3)));
    217
    l_subtrahendNextY = new Double((l_slope * l_x2) + (l_y3 - (l_slope * l_x3)));
    221
    l_minuendNextY = new Double((l_slope * l_x4) + (l_y1 - (l_slope * l_x1)));
    Differences
    Expression1Expression2Difference
    l_subtrahendNextYl_minuendNextYVARIABLE_NAME_MISMATCH
    l_x2l_x4VARIABLE_NAME_MISMATCH
    l_y3l_y1VARIABLE_NAME_MISMATCH
    l_x3l_x1VARIABLE_NAME_MISMATCH
    221
    l_minuendNextY = new Double((l_slope * l_x4) + (l_y1 - (l_slope * l_x1)));
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables l_subtrahendNextX, l_subtrahendNextY , while Clone fragment #2 returns variables l_minuendNextY, l_minuendNextX