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 (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 (y2 >= 0.0) {
1
if (y2 >= 0.0) {
2
                double yright = (y1 + y2) / 2.0 + stackRight[1];
3
                float transYRight
4
                    = (float) rangeAxis.valueToJava2D(yright, dataArea, edge1);
5
                right.moveTo((float) xx1, transStack1);
2
                right.moveTo((float) xx1, transStack1);
6
                right.lineTo((float) xx1, transY1);
3
                right.lineTo((float) xx1, transY1);
7
                right.lineTo((float) xxRight, transYRight);
4
                right.lineTo((float) xxRight, transStackRight);
8
                right.lineTo((float) xxRight, transS
5
                right.closePath();
6
            }
7
            else {
9
tackRight);
8
                double yright = (y1 + y2) / 2.0 + stackRight[0];
10
                right.closePath();
9
                float transYRight = (float) rangeAxis.valueToJava2D(yright,
11
            }
10
            
12
            else {
11
            dataArea, edge1);
13
                right.moveTo((float) xx1, transStack1);
12
                right.moveTo((float) xx1, transStack1);
14
                right.lineTo((float) xx1, transY1);
13
                right.lineTo((float) xx1, transY1);
14
                right.lineTo((float) xxRight, transYRight);
15
                right.lineTo((float) xxRight, transStackRight);
15
                right.lineTo((float) xxRight, transStackRight);
16
                right.closePath();
16
                right.closePath();
17
            }
17
            }
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)39.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    49
    if (y2 >= 0.0)
    77
    if (y2 >= 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);
    78
    right.moveTo((float)xx1, transStack1);
    53
    right.lineTo((float)xx1, transY1);
    79
    right.lineTo((float)xx1, transY1);
    54
    right.lineTo((float)xxRight, transYRight);
    54
    right.lineTo((float)xxRight, transYRight);
    80
    right.lineTo((float)xxRight, transStackRight);
    Differences
    Expression1Expression2Difference
    transYRighttransStackRightVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    80
    right.lineTo((float)xxRight, transStackRight);
    55
    right.lineTo((float)xxRight, transStackRight);
    55
    right.lineTo((float)xxRight, transStackRight);
    81
    right.closePath();
    Differences
    Expression1Expression2Difference
    lineToclosePathMETHOD_INVOCATION_NAME_MISMATCH
    right.lineTo((float)xxRight,transStackRight)right.closePath()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression right.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    Expression right.closePath() is a void method call, and thus it cannot be parameterized
    Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression right.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    Expression right.closePath() is a void method call, and thus it cannot be parameterized
    81
    right.closePath();
    56
    right.closePath();
    56
    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
                                                
    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);
                                                                                      
    84
    right.moveTo((float)xx1, transStack1);
    Preondition Violations
    Unmatched statement right.moveTo((float)xx1,transStack1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    84
    right.moveTo((float)xx1, transStack1);
    57
    right.moveTo((float)xx1, transStack1);
    57
    right.moveTo((float)xx1, transStack1);
    85
    right.lineTo((float)xx1, transY1);
    Differences
    Expression1Expression2Difference
    transStack1transY1VARIABLE_NAME_MISMATCH
    moveTolineToMETHOD_INVOCATION_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 right.lineTo((float)xx1,transY1) 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 right.lineTo((float)xx1,transY1) is a void method call, and thus it cannot be parameterized
    85
    right.lineTo((float)xx1, transY1);
    58
    right.lineTo((float)xx1, transY1);
    58
    right.lineTo((float)xx1, transY1);
    86
    right.lineTo((float)xxRight, transYRight);
    Differences
    Expression1Expression2Difference
    xx1xxRightVARIABLE_NAME_MISMATCH
    transY1transYRightVARIABLE_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);
    59
    right.lineTo((float)xxRight, transStackRight);
    87
    right.lineTo((float)xxRight, transStackRight);
    60
    right.closePath();
    88
    right.closePath();
    Precondition Violations (22)
    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
    5Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression right.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    8Expression right.closePath() is a void method call, and thus it cannot be parameterized
    9Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression right.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    12Expression right.closePath() is a void method call, and thus it cannot be parameterized
    13Unmatched statement right.closePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14Unmatched 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
    15Unmatched 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
    16Unmatched 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
    17Unmatched statement right.moveTo((float)xx1,transStack1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    18Expression right.moveTo((float)xx1,transStack1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19Expression right.lineTo((float)xx1,transY1) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression right.moveTo((float)xx1,transStack1) is a void method call, and thus it cannot be parameterized
    21Expression right.lineTo((float)xx1,transY1) is a void method call, and thus it cannot be parameterized
    22Expression transYRight cannot be parameterized, because it has dependencies to/from statements that will be extracted