if (y2 >= 0.0) { double yright = (y1 + y2) / 2.0 + stackRight[1]; 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(); } else { 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(); }
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(); }
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 (y2 >= 0.0) {
1
if (y0 >= 0.0) {
2
                double yright = (y1 + y2) / 2.0 + stackRight[1];
2
            
3
                float transYRight
4
                    = (float) rangeAxis.valueToJava2D(yright, dataArea, edge1);
5
                if (orientation == PlotOrientation.VERTICAL) {
3
	if (orientation == PlotOrientation.VERTICAL) {
6
                    right.moveTo(transX1, transStack1);
4
                    left.moveTo(transX1, transStack1);
7
                    right.lineTo(transX1, transY1);
5
                    left.lineTo(transX1, transY1);
8
                    right.lineTo(transXRight, transYRight);
6
                    
9
                    right.lineTo(transXRight, transStackRight);
7
left.lineTo(transXLeft, transStackLeft);
10
                }
8
            	}
11
                else {
9
            	else {
12
                    right.moveTo(transStack1, transX1);
10
                    left.moveTo(transStack1, transX1);
13
                    right.lineTo(transY1, transX1);
11
                    left.lineTo(transY1, transX1);
14
                    right.lineTo(transYRight, transXRight);
12
                    left.lineTo(transStackLeft, transXLeft);
15
            
13
            	}
16
        right.lineTo(transStackRight, transXRight);
14
                left.clone();
17
            
15
            }
18
    }
16
            else {
19
                right.closePath();
17
                double yleft = (y0 + y1) / 2.0 + stackLeft[0];
18
                float transYLeft = (float) rangeAxis.valueToJava2D(yleft,
20
            }
19
            
21
            else {
20
            dataArea, edge1);
22
            	if (orientation == PlotOrientation.VERTICAL) {
21
                if (orientation == PlotOrientation.VERTICAL) {
23
                    right.moveTo(transX1, transStack1);
22
                    left.moveTo(transX1, transY1);
24
                    right.lineTo(transX1, transY1);
23
                    left.lineTo(transX1, transStack1);
25
                    right.lineTo(transXRight, transStackRigh
24
                    left.lineTo(transXLeft, transStackLeft);
26
t);
25
                    left.lineTo(transXLeft, transYLeft);
27
            	}
26
                }
28
            	else {
27
                else {
29
                    right.moveTo(transStack1, transX1);
28
                    left.moveTo(transY1, transX1);
30
                    right.lineTo(transY1, transX1);
29
                    left.lineTo(transStack1, transX1);
31
                    right.lineTo(transStackRigh
30
                    left.lineTo(transStackLeft, transXLeft);
32
t, transXRight);
31
                    left.lineTo(transYLeft, transXLeft);
33
            	}
32
                }
34
                right.closePath();
33
                left.closePath();
35
            }
34
            }
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.5
Clones locationClones are in the same method
Number of node comparisons205
  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)26.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    67
    if (y2 >= 0.0)
    67
    if (y2 >= 0.0)
    91
    if (y0 >= 0.0)
    Differences
    Expression1Expression2Difference
    y2y0VARIABLE_NAME_MISMATCH
    y2 >= 0.0y0 >= 0.0IF_ELSE_SYMMETRICAL_MATCH
    91
    if (y0 >= 0.0)
                                      
    99
    left.clone();
    68
    double yright = (y1 + y2) / 2.0 + stackRight[1];
    68
    double yright = (y1 + y2) / 2.0 + stackRight[1];
    100
    double yleft = (y0 + y1) / 2.0 + stackLeft[0];
    Differences
    Expression1Expression2Difference
    yrightyleftVARIABLE_NAME_MISMATCH
    y1y0VARIABLE_NAME_MISMATCH
    y2y1VARIABLE_NAME_MISMATCH
    stackRightstackLeftVARIABLE_NAME_MISMATCH
    10LITERAL_VALUE_MISMATCH
    100
    double yleft = (y0 + y1) / 2.0 + stackLeft[0];
    69
    float transYRight = (float)rangeAxis.valueToJava2D(yright, dataArea, edge1);
    69
    float transYRight = (float)rangeAxis.valueToJava2D(yright, dataArea, edge1);
    101
    float transYLeft = (float)rangeAxis.valueToJava2D(yleft, dataArea, edge1);
    Differences
    Expression1Expression2Difference
    transYRighttransYLeftVARIABLE_NAME_MISMATCH
    yrightyleftVARIABLE_NAME_MISMATCH
    101
    float transYLeft = (float)rangeAxis.valueToJava2D(yleft, dataArea, edge1);
    70
    if (orientation == PlotOrientation.VERTICAL)
    102
    if (orientation == PlotOrientation.VERTICAL)
    71
    right.moveTo(transX1, transStack1);
    71
    right.moveTo(transX1, transStack1);
    103
    left.moveTo(transX1, transY1);
    Differences
    Expression1Expression2Difference
    transStack1transY1VARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    103
    left.moveTo(transX1, transY1);
    72
    right.lineTo(transX1, transY1);
    72
    right.lineTo(transX1, transY1);
    104
    left.lineTo(transX1, transStack1);
    Differences
    Expression1Expression2Difference
    transY1transStack1VARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    104
    left.lineTo(transX1, transStack1);
    73
    right.lineTo(transXRight, transYRight);
    73
    right.lineTo(transXRight, transYRight);
    105
    left.lineTo(transXLeft, transStackLeft);
    Differences
    Expression1Expression2Difference
    transXRighttransXLeftVARIABLE_NAME_MISMATCH
    transYRighttransStackLeftVARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    105
    left.lineTo(transXLeft, transStackLeft);
    74
    right.lineTo(transXRight, transStackRight);
    74
    right.lineTo(transXRight, transStackRight);
    106
    left.lineTo(transXLeft, transYLeft);
    Differences
    Expression1Expression2Difference
    transXRighttransXLeftVARIABLE_NAME_MISMATCH
    transStackRighttransYLeftVARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
    106
    left.lineTo(transXLeft, transYLeft);
    else
    else
    75
    right.moveTo(transStack1, transX1);
    75
    right.moveTo(transStack1, transX1);
    107
    left.moveTo(transY1, transX1);
    Differences
    Expression1Expression2Difference
    transStack1transY1VARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    107
    left.moveTo(transY1, transX1);
    76
    right.lineTo(transY1, transX1);
    76
    right.lineTo(transY1, transX1);
    108
    left.lineTo(transStack1, transX1);
    Differences
    Expression1Expression2Difference
    transY1transStack1VARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    108
    left.lineTo(transStack1, transX1);
    77
    right.lineTo(transYRight, transXRight);
    77
    right.lineTo(transYRight, transXRight);
    109
    left.lineTo(transStackLeft, transXLeft);
    Differences
    Expression1Expression2Difference
    transYRighttransStackLeftVARIABLE_NAME_MISMATCH
    transXRighttransXLeftVARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    109
    left.lineTo(transStackLeft, transXLeft);
    78
    right.lineTo(transStackRight, transXRight);
    78
    right.lineTo(transStackRight, transXRight);
    110
    left.lineTo(transYLeft, transXLeft);
    Differences
    Expression1Expression2Difference
    transStackRighttransYLeftVARIABLE_NAME_MISMATCH
    transXRighttransXLeftVARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
    110
    left.lineTo(transYLeft, transXLeft);
    79
    right.closePath();
    79
    right.closePath();
    111
    left.closePath();
    Differences
    Expression1Expression2Difference
    rightleftVARIABLE_NAME_MISMATCH
    111
    left.closePath();
    else
    else
    80
    if (orientation == PlotOrientation.VERTICAL)
    92
    if (orientation == PlotOrientation.VERTICAL)
    81
    right.moveTo(transX1, transStack1);
    81
    right.moveTo(transX1, transStack1);
    93
    left.moveTo(transX1, transStack1);
    Differences
    Expression1Expression2Difference
    rightleftVARIABLE_NAME_MISMATCH
    93
    left.moveTo(transX1, transStack1);
    82
    right.lineTo(transX1, transY1);
    82
    right.lineTo(transX1, transY1);
    94
    left.lineTo(transX1, transY1);
    Differences
    Expression1Expression2Difference
    rightleftVARIABLE_NAME_MISMATCH
    94
    left.lineTo(transX1, transY1);
    83
    right.lineTo(transXRight, transStackRight);
    83
    right.lineTo(transXRight, transStackRight);
    95
    left.lineTo(transXLeft, transStackLeft);
    Differences
    Expression1Expression2Difference
    transXRighttransXLeftVARIABLE_NAME_MISMATCH
    transStackRighttransStackLeftVARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    95
    left.lineTo(transXLeft, transStackLeft);
    else
    else
    84
    right.moveTo(transStack1, transX1);
    84
    right.moveTo(transStack1, transX1);
    96
    left.moveTo(transStack1, transX1);
    Differences
    Expression1Expression2Difference
    rightleftVARIABLE_NAME_MISMATCH
    96
    left.moveTo(transStack1, transX1);
    85
    right.lineTo(transY1, transX1);
    85
    right.lineTo(transY1, transX1);
    97
    left.lineTo(transY1, transX1);
    Differences
    Expression1Expression2Difference
    rightleftVARIABLE_NAME_MISMATCH
    97
    left.lineTo(transY1, transX1);
    86
    right.lineTo(transStackRight, transXRight);
    86
    right.lineTo(transStackRight, transXRight);
    98
    left.lineTo(transStackLeft, transXLeft);
    Differences
    Expression1Expression2Difference
    transStackRighttransStackLeftVARIABLE_NAME_MISMATCH
    transXRighttransXLeftVARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    98
    left.lineTo(transStackLeft, transXLeft);
    87
    right.closePath();
    87
    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
                                                
    Precondition Violations (5)
    Row Violation
    1Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression transYLeft cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement right.closePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted