if (y2 >= 0.0) { double yright = (y1 + y2) / 2.0 + stackRight[1]; 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(); } else { right.moveTo((float) xx1, transStack1); right.lineTo((float) xx1, transY1); right.lineTo((float) xxRight, transStackRight); right.closePath(); }
if (y0 >= 0.0) { left.moveTo((float) xx1, transStack1); left.lineTo((float) xx1, transY1); left.lineTo((float) xxLeft, transStackLeft); left.clone(); } else { double yleft = (y0 + y1) / 2.0 + stackLeft[0]; 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(); }
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 (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, edge
3
left.moveTo((float) xx1, transStack1);
5
1);
4
                left.lineTo((float) xx1, transY1);
6
                right.moveTo((float) xx1, transStack1);
5
                left.lineTo((float) xxLeft, transStackLeft);
7
                right.lineTo((float) xx1, transY1);
6
                left.clone();
8
            
7
            }
9
    right.lineTo((float) xxRight, transYRight);
8
    
10
                right.lineTo((float) xxRight, transStackRight);
11
                right.closePath();
9
        else {
10
                double yleft = (y0 + y1) / 2.0 + stackLeft[0];
11
                float transYLeft = (float) rangeAxis.valueToJava2D(yleft,
12
            }
12
            
13
            else {
13
            dataArea, edge1);
14
                right.moveTo((float) xx1, transStack1);
14
                left.moveTo((float) xx1, transY1);
15
                right.lineTo((float) xx1, transY1);
15
                left.lineTo((float) xx1, transStack1);
16
                right.lineTo((float) xxRight, transStackRigh
16
                left.lineTo((float) xxLeft, transStackLeft);
17
t);
17
                left.lineTo((float) xxLeft, transYLeft);
18
                right.closePath();
18
                left.closePath();
19
            }
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 statements8
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment4
    Time elapsed for statement mapping (ms)38.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    49
    if (y2 >= 0.0)
    49
    if (y2 >= 0.0)
    64
    if (y0 >= 0.0)
    Differences
    Expression1Expression2Difference
    y2y0VARIABLE_NAME_MISMATCH
    64
    if (y0 >= 0.0)
    50
    double yright = (y1 + y2) / 2.0 + stackRight[1];
    50
    double yright = (y1 + y2) / 2.0 + stackRight[1];
    Preondition Violations
    Unmatched statement double yright=(y1 + y2) / 2.0 + stackRight[1]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                        
    51
    float transYRight = (float)rangeAxis.valueToJava2D(yright, dataArea, edge1);
    51
    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
                                                                                                                                                            
    52
    right.moveTo((float)xx1, transStack1);
    52
    right.moveTo((float)xx1, transStack1);
    65
    left.moveTo((float)xx1, transStack1);
    Differences
    Expression1Expression2Difference
    rightleftVARIABLE_NAME_MISMATCH
    65
    left.moveTo((float)xx1, transStack1);
    53
    right.lineTo((float)xx1, transY1);
    53
    right.lineTo((float)xx1, transY1);
    66
    left.lineTo((float)xx1, transY1);
    Differences
    Expression1Expression2Difference
    rightleftVARIABLE_NAME_MISMATCH
    66
    left.lineTo((float)xx1, transY1);
    54
    right.lineTo((float)xxRight, transYRight);
    54
    right.lineTo((float)xxRight, transYRight);
    67
    left.lineTo((float)xxLeft, transStackLeft);
    Differences
    Expression1Expression2Difference
    xxRightxxLeftVARIABLE_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
    67
    left.lineTo((float)xxLeft, transStackLeft);
    55
    right.lineTo((float)xxRight, transStackRight);
    55
    right.lineTo((float)xxRight, transStackRight);
    Preondition Violations
    Unmatched statement right.lineTo((float)xxRight,transStackRight); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                      
    56
    right.closePath();
    56
    right.closePath();
    Preondition Violations
    Unmatched statement right.closePath(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                
                                      
    68
    left.clone();
    else
    else
                                                                                                    
    69
    double yleft = (y0 + y1) / 2.0 + stackLeft[0];
    Preondition Violations
    Unmatched statement double yleft=(y0 + y1) / 2.0 + stackLeft[0]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    69
    double yleft = (y0 + y1) / 2.0 + stackLeft[0];
                                                                                                                                                        
    70
    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
    70
    float transYLeft = (float)rangeAxis.valueToJava2D(yleft, dataArea, edge1);
                                                                            
    71
    left.moveTo((float)xx1, transY1);
    Preondition Violations
    Unmatched statement left.moveTo((float)xx1,transY1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    71
    left.moveTo((float)xx1, transY1);
    57
    right.moveTo((float)xx1, transStack1);
    57
    right.moveTo((float)xx1, transStack1);
    72
    left.lineTo((float)xx1, transStack1);
    Differences
    Expression1Expression2Difference
    moveTolineToMETHOD_INVOCATION_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    Preondition Violations
    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) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression right.moveTo((float)xx1,transStack1) is a void method call, and thus it cannot be parameterized
    Expression left.lineTo((float)xx1,transStack1) is a void method call, and thus it cannot be parameterized
    72
    left.lineTo((float)xx1, transStack1);
    58
    right.lineTo((float)xx1, transY1);
    58
    right.lineTo((float)xx1, transY1);
    73
    left.lineTo((float)xxLeft, transStackLeft);
    Differences
    Expression1Expression2Difference
    xx1xxLeftVARIABLE_NAME_MISMATCH
    transY1transStackLeftVARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    73
    left.lineTo((float)xxLeft, transStackLeft);
    59
    right.lineTo((float)xxRight, transStackRight);
    59
    right.lineTo((float)xxRight, transStackRight);
    74
    left.lineTo((float)xxLeft, transYLeft);
    Differences
    Expression1Expression2Difference
    xxRightxxLeftVARIABLE_NAME_MISMATCH
    transStackRighttransYLeftVARIABLE_NAME_MISMATCH
    rightleftVARIABLE_NAME_MISMATCH
    74
    left.lineTo((float)xxLeft, transYLeft);
    60
    right.closePath();
    60
    right.closePath();
    75
    left.closePath();
    Differences
    Expression1Expression2Difference
    rightleftVARIABLE_NAME_MISMATCH
    75
    left.closePath();
    Precondition Violations (14)
    Row Violation
    1Unmatched statement double yright=(y1 + y2) / 2.0 + stackRight[1]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched 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
    3Unmatched 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
    4Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Unmatched statement right.lineTo((float)xxRight,transStackRight); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    6Unmatched statement right.closePath(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched statement double yleft=(y0 + y1) / 2.0 + stackLeft[0]; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched 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
    9Unmatched 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
    10Unmatched statement left.moveTo((float)xx1,transY1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11Expression right.moveTo((float)xx1,transStack1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression left.lineTo((float)xx1,transStack1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression right.moveTo((float)xx1,transStack1) is a void method call, and thus it cannot be parameterized
    14Expression left.lineTo((float)xx1,transStack1) is a void method call, and thus it cannot be parameterized