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)12.3
    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);
                                                                                                                                                            
    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
    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);
    57
    right.moveTo((float)xx1, transStack1);
    84
    right.moveTo((float)xx1, transStack1);
    58
    right.lineTo((float)xx1, transY1);
    85
    right.lineTo((float)xx1, transY1);
    59
    right.lineTo((float)xxRight, transStackRight);
    59
    right.lineTo((float)xxRight, transStackRight);
    86
    right.lineTo((float)xxRight, transYRight);
    Differences
    Expression1Expression2Difference
    transStackRighttransYRightVARIABLE_NAME_MISMATCH
    86
    right.lineTo((float)xxRight, transYRight);
    60
    right.closePath();
    60
    right.closePath();
    87
    right.lineTo((float)xxRight, transStackRight);
    Differences
    Expression1Expression2Difference
    closePathlineToMETHOD_INVOCATION_NAME_MISMATCH
    right.closePath()right.lineTo((float)xxRight,transStackRight)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression right.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 right.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 right.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 right.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 (20)
    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
    2Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression right.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    5Expression right.closePath() is a void method call, and thus it cannot be parameterized
    6Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression right.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    9Expression right.closePath() is a void method call, and thus it cannot be parameterized
    10Unmatched statement right.closePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11Unmatched 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
    12Expression right.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression right.closePath() is a void method call, and thus it cannot be parameterized
    15Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    16Expression right.closePath() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression right.lineTo((float)xxRight,transStackRight) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression right.closePath() is a void method call, and thus it cannot be parameterized
    19Expression right.lineTo((float)xxRight,transStackRight) is a void method call, and thus it cannot be parameterized
    20Unmatched statement right.closePath(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted