if (y0 >= 0.0) { if (orientation == PlotOrientation.VERTICAL) { left.moveTo(transX1, transStack1); left.lineTo(transX1, transY1); left.lineTo(transXLeft, transStackLeft); } else { left.moveTo(transStack1, transX1); left.lineTo(transY1, transX1); left.lineTo(transStackLeft, transXLeft); } left.clone(); } else { double yleft = (y0 + y1) / 2.0 + stackLeft[0]; float transYLeft = (float) rangeAxis.valueToJava2D(yleft, dataArea, edge1); if (orientation == PlotOrientation.VERTICAL) { left.moveTo(transX1, transY1); left.lineTo(transX1, transStack1); left.lineTo(transXLeft, transStackLeft); left.lineTo(transXLeft, transYLeft); } else { left.moveTo(transY1, transX1); left.lineTo(transStack1, transX1); left.lineTo(transStackLeft, transXLeft); left.lineTo(transYLeft, transXLeft); } left.closePath(); }
if (y2 >= 0.0) { if (orientation == PlotOrientation.VERTICAL) { right.moveTo(transX1, transStack1); right.lineTo(transX1, transY1); right.lineTo(transXRight, transStackRight); } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); right.lineTo(transStackRight, transXRight); } right.closePath(); } else { double yright = (y1 + y2) / 2.0 + stackRight[0]; float transYRight = (float) rangeAxis.valueToJava2D(yright, dataArea, edge1); if (orientation == PlotOrientation.VERTICAL) { right.moveTo(transX1, transStack1); right.lineTo(transX1, transY1); right.lineTo(transXRight, transYRight); right.lineTo(transXRight, transStackRight); } else { right.moveTo(transStack1, transX1); right.lineTo(transY1, transX1); right.lineTo(transYRight, transXRight); right.lineTo(transStackRight, transXRight); } right.closePath(); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StackedXYAreaRenderer2.java
Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int) Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
Number of AST nodes: 21 Number of AST nodes: 21
1
if (y0 >= 0.0) {
1
if (y2 >= 0.0) {
2
            	if (orientation == PlotOrientation.VERTICAL) {
2
            	if (orientation == PlotOrientation.VERTICAL) {
3
                    left.moveTo(transX1, transStack1);
3
                    right.moveTo(transX1, transStack1);
4
                    left.lineTo(transX1, transY1);
4
                    right.lineTo(transX1, transY1);
5
                    left.lineTo(transXLeft, transStackLeft);
5
                    right.lineTo(transXRight, transStackRight);
6
            	}
6
            	}
7
            	else {
7
            	else {
8
                    left.moveTo(transStack1, transX1);
8
                    right.moveTo(transStack1, transX1);
9
                    left.lineTo(transY1, transX1);
9
                    right.lineTo(transY1, transX1);
10
                    left.lineTo(transStackLeft, transXLeft);
10
                    right.lineTo(transStackRight, transXRight);
11
            	}
11
            	}
12
                left.clone();
12
                right.closePath();
13
            }
13
            }
14
            else {
14
            else {
15
                double yleft = (y0 + y1) / 2.0 + stackLeft[0];
15
                double yright = (y1 + y2) / 2.0 + stackRight[0];
16
                float transYLeft = (float) rangeAxis.valueToJava2D(yleft,
16
                float transYRight = (float) rangeAxis.valueToJava2D(yright,
17
                        dataArea, edge1);
17
                        dataArea, edge1);
18
                if (orientation == PlotOrientation.VERTICAL) {
18
                if (orientation == PlotOrientation.VERTICAL) {
19
                    left.moveTo(transX1, transY1);
19
                    right.moveTo(transX1, transStack1);
20
                    left.lineTo(transX1, transStack1);
20
                    right.lineTo(transX1, transY1);
21
                    left.lineTo(transXLeft, transStackLeft);
21
                    right.lineTo(transXRight, transYRight);
22
                    left.lineTo(transXLeft, transYLeft);
22
                    right.lineTo(transXRight, transStackRight);
23
                }
23
                }
24
                else {
24
                else {
25
                    left.moveTo(transY1, transX1);
25
                    right.moveTo(transStack1, transX1);
26
                    left.lineTo(transStack1, transX1);
26
                    right.lineTo(transY1, transX1);
27
                    left.lineTo(transStackLeft, transXLeft);
27
                    right.lineTo(transYRight, transXRight);
28
                    left.lineTo(transYLeft, transXLeft);
28
                    right.lineTo(transStackRight, transXRight);
29
                }
29
                }
30
                left.closePath();
30
                right.closePath();
31
            }
31
            }
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)1.1
Clones locationClones are in the same method
Number of node comparisons226
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements20
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)80.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    91
    if (y0 >= 0.0)
    91
    if (y0 >= 0.0)
    113
    if (y2 >= 0.0)
    Differences
    Expression1Expression2Difference
    y0y2VARIABLE_NAME_MISMATCH
    113
    if (y2 >= 0.0)
    92
    if (orientation == PlotOrientation.VERTICAL)
    114
    if (orientation == PlotOrientation.VERTICAL)
    93
    left.moveTo(transX1, transStack1);
    93
    left.moveTo(transX1, transStack1);
    115
    right.moveTo(transX1, transStack1);
    Differences
    Expression1Expression2Difference
    leftrightVARIABLE_NAME_MISMATCH
    115
    right.moveTo(transX1, transStack1);
    94
    left.lineTo(transX1, transY1);
    94
    left.lineTo(transX1, transY1);
    116
    right.lineTo(transX1, transY1);
    Differences
    Expression1Expression2Difference
    leftrightVARIABLE_NAME_MISMATCH
    116
    right.lineTo(transX1, transY1);
    95
    left.lineTo(transXLeft, transStackLeft);
    95
    left.lineTo(transXLeft, transStackLeft);
    117
    right.lineTo(transXRight, transStackRight);
    Differences
    Expression1Expression2Difference
    transXLefttransXRightVARIABLE_NAME_MISMATCH
    transStackLefttransStackRightVARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    117
    right.lineTo(transXRight, transStackRight);
    else
    else
    96
    left.moveTo(transStack1, transX1);
    96
    left.moveTo(transStack1, transX1);
    118
    right.moveTo(transStack1, transX1);
    Differences
    Expression1Expression2Difference
    leftrightVARIABLE_NAME_MISMATCH
    118
    right.moveTo(transStack1, transX1);
    97
    left.lineTo(transY1, transX1);
    97
    left.lineTo(transY1, transX1);
    119
    right.lineTo(transY1, transX1);
    Differences
    Expression1Expression2Difference
    leftrightVARIABLE_NAME_MISMATCH
    119
    right.lineTo(transY1, transX1);
    98
    left.lineTo(transStackLeft, transXLeft);
    98
    left.lineTo(transStackLeft, transXLeft);
    120
    right.lineTo(transStackRight, transXRight);
    Differences
    Expression1Expression2Difference
    transStackLefttransStackRightVARIABLE_NAME_MISMATCH
    transXLefttransXRightVARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    120
    right.lineTo(transStackRight, transXRight);
    99
    left.clone();
                                      
                                                  
    121
    right.closePath();
    Preondition Violations
    Unmatched statement right.closePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    121
    right.closePath();
    else
    else
    100
    double yleft = (y0 + y1) / 2.0 + stackLeft[0];
    100
    double yleft = (y0 + y1) / 2.0 + stackLeft[0];
    122
    double yright = (y1 + y2) / 2.0 + stackRight[0];
    Differences
    Expression1Expression2Difference
    yleftyrightVARIABLE_NAME_MISMATCH
    y0y1VARIABLE_NAME_MISMATCH
    y1y2VARIABLE_NAME_MISMATCH
    stackLeftstackRightVARIABLE_NAME_MISMATCH
    122
    double yright = (y1 + y2) / 2.0 + stackRight[0];
    101
    float transYLeft = (float)rangeAxis.valueToJava2D(yleft, dataArea, edge1);
    101
    float transYLeft = (float)rangeAxis.valueToJava2D(yleft, dataArea, edge1);
    123
    float transYRight = (float)rangeAxis.valueToJava2D(yright, dataArea, edge1);
    Differences
    Expression1Expression2Difference
    transYLefttransYRightVARIABLE_NAME_MISMATCH
    yleftyrightVARIABLE_NAME_MISMATCH
    123
    float transYRight = (float)rangeAxis.valueToJava2D(yright, dataArea, edge1);
    102
    if (orientation == PlotOrientation.VERTICAL)
    124
    if (orientation == PlotOrientation.VERTICAL)
    103
    left.moveTo(transX1, transY1);
    103
    left.moveTo(transX1, transY1);
    125
    right.moveTo(transX1, transStack1);
    Differences
    Expression1Expression2Difference
    transY1transStack1VARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    125
    right.moveTo(transX1, transStack1);
    104
    left.lineTo(transX1, transStack1);
    104
    left.lineTo(transX1, transStack1);
    126
    right.lineTo(transX1, transY1);
    Differences
    Expression1Expression2Difference
    transStack1transY1VARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    126
    right.lineTo(transX1, transY1);
    105
    left.lineTo(transXLeft, transStackLeft);
    105
    left.lineTo(transXLeft, transStackLeft);
    127
    right.lineTo(transXRight, transYRight);
    Differences
    Expression1Expression2Difference
    transXLefttransXRightVARIABLE_NAME_MISMATCH
    transStackLefttransYRightVARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    127
    right.lineTo(transXRight, transYRight);
    106
    left.lineTo(transXLeft, transYLeft);
    106
    left.lineTo(transXLeft, transYLeft);
    128
    right.lineTo(transXRight, transStackRight);
    Differences
    Expression1Expression2Difference
    transXLefttransXRightVARIABLE_NAME_MISMATCH
    transYLefttransStackRightVARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
    128
    right.lineTo(transXRight, transStackRight);
    else
    else
    107
    left.moveTo(transY1, transX1);
    107
    left.moveTo(transY1, transX1);
    129
    right.moveTo(transStack1, transX1);
    Differences
    Expression1Expression2Difference
    transY1transStack1VARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    129
    right.moveTo(transStack1, transX1);
    108
    left.lineTo(transStack1, transX1);
    108
    left.lineTo(transStack1, transX1);
    130
    right.lineTo(transY1, transX1);
    Differences
    Expression1Expression2Difference
    transStack1transY1VARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    130
    right.lineTo(transY1, transX1);
    109
    left.lineTo(transStackLeft, transXLeft);
    109
    left.lineTo(transStackLeft, transXLeft);
    131
    right.lineTo(transYRight, transXRight);
    Differences
    Expression1Expression2Difference
    transStackLefttransYRightVARIABLE_NAME_MISMATCH
    transXLefttransXRightVARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    131
    right.lineTo(transYRight, transXRight);
    110
    left.lineTo(transYLeft, transXLeft);
    110
    left.lineTo(transYLeft, transXLeft);
    132
    right.lineTo(transStackRight, transXRight);
    Differences
    Expression1Expression2Difference
    transYLefttransStackRightVARIABLE_NAME_MISMATCH
    transXLefttransXRightVARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
    132
    right.lineTo(transStackRight, transXRight);
    111
    left.closePath();
    111
    left.closePath();
    133
    right.closePath();
    Differences
    Expression1Expression2Difference
    leftrightVARIABLE_NAME_MISMATCH
    133
    right.closePath();
    Precondition Violations (5)
    Row Violation
    1Unmatched statement right.closePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted