if (y0 >= 0.0) { double yleft = (y0 + y1) / 2.0 + stackLeft[1]; float transYLeft = (float) rangeAxis.valueToJava2D(yleft, dataArea, edge1); left.moveTo((float) xx1, transY1); left.lineTo((float) xx1, transStack1); left.lineTo((float) xxLeft, transStackLeft); left.lineTo((float) xxLeft, transYLeft); left.closePath(); } else { left.moveTo((float) xx1, transStack1); left.lineTo((float) xx1, transY1); left.lineTo((float) xxLeft, transStackLeft); left.closePath(); }
if (y2 >= 0.0) { right.moveTo((float) xx1, transStack1); right.lineTo((float) xx1, transY1); right.lineTo((float) xxRight, transStackRight); right.closePath(); } else { double yright = (y1 + y2) / 2.0 + stackRight[0]; float transYRight = (float) rangeAxis.valueToJava2D(yright, dataArea, edge1); right.moveTo((float) xx1, transStack1); right.lineTo((float) xx1, transY1); right.lineTo((float) xxRight, transYRight); right.lineTo((float) xxRight, transStackRight); right.closePath(); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedAreaRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/StackedAreaRenderer.java
Method name: void drawItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int, int) Method name: void drawItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int, int)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (y0 >= 0.0) {
1
if (y2 >= 0.0) {
2
                double yleft = (y0 + y1) / 2.0 + stackLeft[1];
2
                
3
                float transYLeft
4
                    = (float) rangeAxis.valueToJava2D(yleft, dataArea, edge1);
3
right.moveTo((float) xx1, transStack1);
5
                left.moveTo((float) xx1, transY1);
4
                right.lineTo((float) xx1, transY1);
6
                left.lineTo((float) xx1, transStack1);
5
                right.lineTo((float) xxRight, transStackRight);
7
                left.lineTo((float) xxLeft, transStackLeft);
6
                
8
                left.lineTo((float) xxLeft, transYLeft);
9
                left.closePath();
7
right.closePath();
8
            }
9
            else {
10
                double yright = (y1 + y2) / 2.0 + stackRight[0];
11
                float transYRight = (float) rangeAxis.valueToJava2D(yright,
10
            }
12
            
11
            else {
13
            dataArea, edge1);
12
                left.moveTo((float) xx1, transStack1);
14
                right.moveTo((float) xx1, transStack1);
13
                left.lineTo((float) xx1, transY1);
15
                right.lineTo((float) xx1, transY1);
14
                lef
16
                right.lineTo((float) xxRight, transYRight);
15
t.lineTo((float) xxLeft, transStackLeft);
17
                right.lineTo((float) xxRight, transStackRight);
16
                left.closePath();
18
                right.closePath();
17
            }
19
            }
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.1
Clones locationClones are in the same method
Number of node comparisons144
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)43.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    36
    if (y0 >= 0.0)
    36
    if (y0 >= 0.0)
    77
    if (y2 >= 0.0)
    Differences
    Expression1Expression2Difference
    y0y2VARIABLE_NAME_MISMATCH
    77
    if (y2 >= 0.0)
    37
    double yleft = (y0 + y1) / 2.0 + stackLeft[1];
    37
    double yleft = (y0 + y1) / 2.0 + stackLeft[1];
    Preondition Violations
    Unmatched statement double yleft=(y0 + y1) / 2.0 + stackLeft[1]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                    
    38
    float transYLeft = (float)rangeAxis.valueToJava2D(yleft, dataArea, edge1);
    38
    float transYLeft = (float)rangeAxis.valueToJava2D(yleft, dataArea, edge1);
    Preondition Violations
    Unmatched statement float transYLeft=(float)rangeAxis.valueToJava2D(yleft,dataArea,edge1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement float transYLeft=(float)rangeAxis.valueToJava2D(yleft,dataArea,edge1); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
                                                                                                                                                        
    39
    left.moveTo((float)xx1, transY1);
    39
    left.moveTo((float)xx1, transY1);
    Preondition Violations
    Unmatched statement left.moveTo((float)xx1,transY1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                            
    40
    left.lineTo((float)xx1, transStack1);
    40
    left.lineTo((float)xx1, transStack1);
    78
    right.moveTo((float)xx1, transStack1);
    Differences
    Expression1Expression2Difference
    lineTomoveToMETHOD_INVOCATION_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression left.lineTo((float)xx1,transStack1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression right.moveTo((float)xx1,transStack1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression left.lineTo((float)xx1,transStack1) is a void method call, and thus it cannot be parameterized
    Expression right.moveTo((float)xx1,transStack1) is a void method call, and thus it cannot be parameterized
    78
    right.moveTo((float)xx1, transStack1);
    41
    left.lineTo((float)xxLeft, transStackLeft);
    41
    left.lineTo((float)xxLeft, transStackLeft);
    79
    right.lineTo((float)xx1, transY1);
    Differences
    Expression1Expression2Difference
    xxLeftxx1VARIABLE_NAME_MISMATCH
    transStackLefttransY1VARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    79
    right.lineTo((float)xx1, transY1);
    42
    left.lineTo((float)xxLeft, transYLeft);
    42
    left.lineTo((float)xxLeft, transYLeft);
    80
    right.lineTo((float)xxRight, transStackRight);
    Differences
    Expression1Expression2Difference
    xxLeftxxRightVARIABLE_NAME_MISMATCH
    transYLefttransStackRightVARIABLE_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    80
    right.lineTo((float)xxRight, transStackRight);
    43
    left.closePath();
    43
    left.closePath();
    81
    right.closePath();
    Differences
    Expression1Expression2Difference
    leftrightVARIABLE_NAME_MISMATCH
    81
    right.closePath();
    else
    else
                                                                                                        
    82
    double yright = (y1 + y2) / 2.0 + stackRight[0];
    Preondition Violations
    Unmatched statement double yright=(y1 + y2) / 2.0 + stackRight[0]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    82
    double yright = (y1 + y2) / 2.0 + stackRight[0];
                                                                                                                                                            
    83
    float transYRight = (float)rangeAxis.valueToJava2D(yright, dataArea, edge1);
    Preondition Violations
    Unmatched statement float transYRight=(float)rangeAxis.valueToJava2D(yright,dataArea,edge1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched statement float transYRight=(float)rangeAxis.valueToJava2D(yright,dataArea,edge1); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    83
    float transYRight = (float)rangeAxis.valueToJava2D(yright, dataArea, edge1);
    44
    left.moveTo((float)xx1, transStack1);
    44
    left.moveTo((float)xx1, transStack1);
    84
    right.moveTo((float)xx1, transStack1);
    Differences
    Expression1Expression2Difference
    leftrightVARIABLE_NAME_MISMATCH
    84
    right.moveTo((float)xx1, transStack1);
    45
    left.lineTo((float)xx1, transY1);
    45
    left.lineTo((float)xx1, transY1);
    85
    right.lineTo((float)xx1, transY1);
    Differences
    Expression1Expression2Difference
    leftrightVARIABLE_NAME_MISMATCH
    85
    right.lineTo((float)xx1, transY1);
    46
    left.lineTo((float)xxLeft, transStackLeft);
    46
    left.lineTo((float)xxLeft, transStackLeft);
    86
    right.lineTo((float)xxRight, transYRight);
    Differences
    Expression1Expression2Difference
    xxLeftxxRightVARIABLE_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
    86
    right.lineTo((float)xxRight, transYRight);
    47
    left.closePath();
    47
    left.closePath();
    87
    right.lineTo((float)xxRight, transStackRight);
    Differences
    Expression1Expression2Difference
    closePathlineToMETHOD_INVOCATION_NAME_MISMATCH
    leftrightVARIABLE_NAME_MISMATCH
    left.closePath()right.lineTo((float)xxRight,transStackRight)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression left.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression left.closePath() is a void method call, and thus it cannot be parameterized
    Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    Expression left.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression left.closePath() is a void method call, and thus it cannot be parameterized
    Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    87
    right.lineTo((float)xxRight, transStackRight);
                                                
    88
    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
    88
    right.closePath();
    Precondition Violations (21)
    Row Violation
    1Unmatched statement double yleft=(y0 + y1) / 2.0 + stackLeft[1]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement float transYLeft=(float)rangeAxis.valueToJava2D(yleft,dataArea,edge1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement float transYLeft=(float)rangeAxis.valueToJava2D(yleft,dataArea,edge1); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    4Unmatched statement left.moveTo((float)xx1,transY1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Expression left.lineTo((float)xx1,transStack1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression right.moveTo((float)xx1,transStack1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression left.lineTo((float)xx1,transStack1) is a void method call, and thus it cannot be parameterized
    8Expression right.moveTo((float)xx1,transStack1) is a void method call, and thus it cannot be parameterized
    9Unmatched statement double yright=(y1 + y2) / 2.0 + stackRight[0]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10Unmatched statement float transYRight=(float)rangeAxis.valueToJava2D(yright,dataArea,edge1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    11Unmatched statement float transYRight=(float)rangeAxis.valueToJava2D(yright,dataArea,edge1); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted
    12Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression left.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression left.closePath() is a void method call, and thus it cannot be parameterized
    16Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    17Expression left.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression left.closePath() is a void method call, and thus it cannot be parameterized
    20Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    21Unmatched statement right.closePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted