double xxQ1 = rangeAxis.valueToJava2D(xQ1.doubleValue(), dataArea, location); double xxQ3 = rangeAxis.valueToJava2D(xQ3.doubleValue(), dataArea, location); double xxMax = rangeAxis.valueToJava2D(xMax.doubleValue(), dataArea, location); double xxMin = rangeAxis.valueToJava2D(xMin.doubleValue(), dataArea, location); double yymid = yy + state.getBarWidth() / 2.0; // draw the upper shadow... g2.draw(new Line2D.Double(xxMax, yymid, xxQ3, yymid)); g2.draw(new Line2D.Double(xxMax, yy, xxMax, yy + state.getBarWidth())); // draw the lower shadow... g2.draw(new Line2D.Double(xxMin, yymid, xxQ1, yymid)); g2.draw(new Line2D.Double(xxMin, yy, xxMin, yy + state.getBarWidth())); // draw the box... box = new Rectangle2D.Double(Math.min(xxQ1, xxQ3), yy, Math.abs(xxQ1 - xxQ3), state.getBarWidth()); if (this.fillBox) { g2.fill(box); } g2.setStroke(getItemOutlineStroke(row, column)); g2.setPaint(getItemOutlinePaint(row, column)); g2.draw(box);
double yyQ1 = rangeAxis.valueToJava2D(yQ1.doubleValue(), dataArea, location); double yyQ3 = rangeAxis.valueToJava2D(yQ3.doubleValue(), dataArea, location); double yyMax = rangeAxis.valueToJava2D(yMax.doubleValue(), dataArea, location); double yyMin = rangeAxis.valueToJava2D(yMin.doubleValue(), dataArea, location); double xxmid = xx + state.getBarWidth() / 2.0; // draw the upper shadow... g2.draw(new Line2D.Double(xxmid, yyMax, xxmid, yyQ3)); g2.draw(new Line2D.Double(xx, yyMax, xx + state.getBarWidth(), yyMax)); // draw the lower shadow... g2.draw(new Line2D.Double(xxmid, yyMin, xxmid, yyQ1)); g2.draw(new Line2D.Double(xx, yyMin, xx + state.getBarWidth(), yyMin)); // draw the body... box = new Rectangle2D.Double(xx, Math.min(yyQ1, yyQ3), state.getBarWidth(), Math.abs(yyQ1 - yyQ3)); if (this.fillBox) { g2.fill(box); } g2.setStroke(getItemOutlineStroke(row, column)); g2.setPaint(getItemOutlinePaint(row, column)); g2.draw(box);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/BoxAndWhiskerRenderer.java
Method name: void drawHorizontalItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int) Method name: void drawVerticalItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int)
Number of AST nodes: 15 Number of AST nodes: 15
1
double xxQ1 = rangeAxis.valueToJava2D(xQ1.doubleValue(), dataArea,
1
double yyQ1 = rangeAxis.valueToJava2D(yQ1.doubleValue(), dataArea,
2
                    location);
2
                    location);
3
            double xxQ3 = rangeAxis.valueToJava2D(xQ3.doubleValue(), dataArea,
3
            double yyQ3 = rangeAxis.valueToJava2D(yQ3.doubleValue(), dataArea,
4
                    location);
4
                    location);
5
            double xxMax = rangeAxis.valueToJava2D(xMax.doubleValue(), dataArea,
5
            double yyMax = rangeAxis.valueToJava2D(yMax.doubleValue(),
6
                    location);
6
                    dataArea, location);
7
            double xxMin = rangeAxis.valueToJava2D(xMin.doubleValue(), dataArea,
7
            double yyMin = rangeAxis.valueToJava2D(yMin.doubleValue(),
8
                    location);
8
                    dataArea, location);
9
            double yymid = yy + state.getBarWidth() / 2.0;
9
            double xxmid = xx + state.getBarWidth() / 2.0;
10
            // draw the upper shadow...
10
            // draw the upper shadow...
11
            g2.draw(new Line2D.Double(xxMax, yymid, xxQ3, yymid));
11
            g2.draw(new Line2D.Double(xxmid, yyMax, xxmid, yyQ3));
12
            g2.draw(new Line2D.Double(xxMax, yy, xxMax,
12
            g2.draw(new Line2D.Double(xx, yyMax, xx + state.getBarWidth(),
13
                    yy + state.getBarWidth()));
13
                    yyMax));
14
            // draw the lower shadow...
14
            // draw the lower shadow...
15
            g2.draw(new Line2D.Double(xxMin, yymid, xxQ1, yymid));
15
            g2.draw(new Line2D.Double(xxmid, yyMin, xxmid, yyQ1));
16
            g2.draw(new Line2D.Double(xxMin, yy, xxMin,
16
            g2.draw(new Line2D.Double(xx, yyMin, xx + state.getBarWidth(),
17
                    yy + state.getBarWidth()));
17
                    yyMin));
18
            // draw the box...
18
            // draw the body...
19
            box = new Rectangle2D.Double(Math.min(xxQ1, xxQ3), yy,
19
            box = new Rectangle2D.Double(xx, Math.min(yyQ1, yyQ3),
20
                    Math.abs(xxQ1 - xxQ3), state.getBarWidth());
20
                    state.getBarWidth(), Math.abs(yyQ1 - yyQ3));
21
            if (this.fillBox) {
21
            if (this.fillBox) {
22
                g2.fill(box);
22
                g2.fill(box);
23
            }
23
            }
24
            g2.setStroke(getItemOutlineStroke(row, column));
24
            g2.setStroke(getItemOutlineStroke(row, column));
25
            g2.setPaint(getItemOutlinePaint(row, column));
25
            g2.setPaint(getItemOutlinePaint(row, column));
26
            g2.draw(box);
26
            g2.draw(box);
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.4
Clones locationClones are declared in the same class
Number of node comparisons174
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)130.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    25
    double xxQ1 = rangeAxis.valueToJava2D(xQ1.doubleValue(), dataArea, location);
    25
    double xxQ1 = rangeAxis.valueToJava2D(xQ1.doubleValue(), dataArea, location);
    29
    double yyQ1 = rangeAxis.valueToJava2D(yQ1.doubleValue(), dataArea, location);
    Differences
    Expression1Expression2Difference
    xxQ1yyQ1VARIABLE_NAME_MISMATCH
    xQ1yQ1VARIABLE_NAME_MISMATCH
    29
    double yyQ1 = rangeAxis.valueToJava2D(yQ1.doubleValue(), dataArea, location);
    26
    double xxQ3 = rangeAxis.valueToJava2D(xQ3.doubleValue(), dataArea, location);
    26
    double xxQ3 = rangeAxis.valueToJava2D(xQ3.doubleValue(), dataArea, location);
    30
    double yyQ3 = rangeAxis.valueToJava2D(yQ3.doubleValue(), dataArea, location);
    Differences
    Expression1Expression2Difference
    xxQ3yyQ3VARIABLE_NAME_MISMATCH
    xQ3yQ3VARIABLE_NAME_MISMATCH
    30
    double yyQ3 = rangeAxis.valueToJava2D(yQ3.doubleValue(), dataArea, location);
    27
    double xxMax = rangeAxis.valueToJava2D(xMax.doubleValue(), dataArea, location);
    27
    double xxMax = rangeAxis.valueToJava2D(xMax.doubleValue(), dataArea, location);
    33
    double xxmid = xx + state.getBarWidth() / 2.0;
    Differences
    Expression1Expression2Difference
    xxMaxxxmidVARIABLE_NAME_MISMATCH
    rangeAxis.valueToJava2D(xMax.doubleValue(),dataArea,location)xx + state.getBarWidth() / 2.0TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression rangeAxis.valueToJava2D(xMax.doubleValue(),dataArea,location) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    33
    double xxmid = xx + state.getBarWidth() / 2.0;
    28
    double xxMin = rangeAxis.valueToJava2D(xMin.doubleValue(), dataArea, location);
    28
    double xxMin = rangeAxis.valueToJava2D(xMin.doubleValue(), dataArea, location);
    32
    double yyMin = rangeAxis.valueToJava2D(yMin.doubleValue(), dataArea, location);
    Differences
    Expression1Expression2Difference
    xxMinyyMinVARIABLE_NAME_MISMATCH
    xMinyMinVARIABLE_NAME_MISMATCH
    32
    double yyMin = rangeAxis.valueToJava2D(yMin.doubleValue(), dataArea, location);
    29
    double yymid = yy + state.getBarWidth() / 2.0;
    29
    double yymid = yy + state.getBarWidth() / 2.0;
    31
    double yyMax = rangeAxis.valueToJava2D(yMax.doubleValue(), dataArea, location);
    Differences
    Expression1Expression2Difference
    yymidyyMaxVARIABLE_NAME_MISMATCH
    yy + state.getBarWidth() / 2.0rangeAxis.valueToJava2D(yMax.doubleValue(),dataArea,location)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression rangeAxis.valueToJava2D(yMax.doubleValue(),dataArea,location) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    31
    double yyMax = rangeAxis.valueToJava2D(yMax.doubleValue(), dataArea, location);
    30
    g2.draw(new Line2D.Double(xxMax, yymid, xxQ3, yymid));
    30
    g2.draw(new Line2D.Double(xxMax, yymid, xxQ3, yymid));
    34
    g2.draw(new Line2D.Double(xxmid, yyMax, xxmid, yyQ3));
    Differences
    Expression1Expression2Difference
    xxMaxxxmidVARIABLE_NAME_MISMATCH
    yymidyyMaxVARIABLE_NAME_MISMATCH
    xxQ3xxmidVARIABLE_NAME_MISMATCH
    yymidyyQ3VARIABLE_NAME_MISMATCH
    34
    g2.draw(new Line2D.Double(xxmid, yyMax, xxmid, yyQ3));
    31
    g2.draw(new Line2D.Double(xxMax, yy, xxMax, yy + state.getBarWidth()));
    31
    g2.draw(new Line2D.Double(xxMax, yy, xxMax, yy + state.getBarWidth()));
    36
    g2.draw(new Line2D.Double(xxmid, yyMin, xxmid, yyQ1));
    Differences
    Expression1Expression2Difference
    xxMaxxxmidVARIABLE_NAME_MISMATCH
    yyyyMinVARIABLE_NAME_MISMATCH
    xxMaxxxmidVARIABLE_NAME_MISMATCH
    yy + state.getBarWidth()yyQ1TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression yyMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yyQ1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    36
    g2.draw(new Line2D.Double(xxmid, yyMin, xxmid, yyQ1));
    32
    g2.draw(new Line2D.Double(xxMin, yymid, xxQ1, yymid));
    32
    g2.draw(new Line2D.Double(xxMin, yymid, xxQ1, yymid));
    35
    g2.draw(new Line2D.Double(xx, yyMax, xx + state.getBarWidth(), yyMax));
    Differences
    Expression1Expression2Difference
    xxMinxxVARIABLE_NAME_MISMATCH
    yymidyyMaxVARIABLE_NAME_MISMATCH
    xxQ1xx + state.getBarWidth()TYPE_COMPATIBLE_REPLACEMENT
    yymidyyMaxVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression xxMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xxQ1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    35
    g2.draw(new Line2D.Double(xx, yyMax, xx + state.getBarWidth(), yyMax));
    33
    g2.draw(new Line2D.Double(xxMin, yy, xxMin, yy + state.getBarWidth()));
    33
    g2.draw(new Line2D.Double(xxMin, yy, xxMin, yy + state.getBarWidth()));
    37
    g2.draw(new Line2D.Double(xx, yyMin, xx + state.getBarWidth(), yyMin));
    Differences
    Expression1Expression2Difference
    xxMinxxVARIABLE_NAME_MISMATCH
    yyyyMinVARIABLE_NAME_MISMATCH
    xxMinxx + state.getBarWidth()TYPE_COMPATIBLE_REPLACEMENT
    yy + state.getBarWidth()yyMinTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression xxMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yyMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xxMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yyMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    37
    g2.draw(new Line2D.Double(xx, yyMin, xx + state.getBarWidth(), yyMin));
    34
    box = new Rectangle2D.Double(Math.min(xxQ1, xxQ3), yy, Math.abs(xxQ1 - xxQ3), state.getBarWidth());
    34
    box = new Rectangle2D.Double(Math.min(xxQ1, xxQ3), yy, Math.abs(xxQ1 - xxQ3), state.getBarWidth());
    Preondition Violations
    Unmatched statement box=new Rectangle2D.Double(Math.min(xxQ1,xxQ3),yy,Math.abs(xxQ1 - xxQ3),state.getBarWidth()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                                                                                                                      
                                                                                                                                                                                                      
    38
    box = new Rectangle2D.Double(xx, Math.min(yyQ1, yyQ3), state.getBarWidth(), Math.abs(yyQ1 - yyQ3));
    Preondition Violations
    Unmatched statement box=new Rectangle2D.Double(xx,Math.min(yyQ1,yyQ3),state.getBarWidth(),Math.abs(yyQ1 - yyQ3)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    38
    box = new Rectangle2D.Double(xx, Math.min(yyQ1, yyQ3), state.getBarWidth(), Math.abs(yyQ1 - yyQ3));
    35
    if (this.fillBox)
    39
    if (this.fillBox)
    36
    g2.fill(box);
    40
    g2.fill(box);
    37
    g2.setStroke(getItemOutlineStroke(row, column));
    41
    g2.setStroke(getItemOutlineStroke(row, column));
    38
    g2.setPaint(getItemOutlinePaint(row, column));
    42
    g2.setPaint(getItemOutlinePaint(row, column));
    39
    g2.draw(box);
    43
    g2.draw(box);
    Precondition Violations (13)
    Row Violation
    1Expression rangeAxis.valueToJava2D(xMax.doubleValue(),dataArea,location) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression rangeAxis.valueToJava2D(yMax.doubleValue(),dataArea,location) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression yyMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression yyQ1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression xxMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression xxQ1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression xxMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression yyMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression xxMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression yyMin cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Unmatched statement box=new Rectangle2D.Double(Math.min(xxQ1,xxQ3),yy,Math.abs(xxQ1 - xxQ3),state.getBarWidth()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    12Unmatched statement box=new Rectangle2D.Double(xx,Math.min(yyQ1,yyQ3),state.getBarWidth(),Math.abs(yyQ1 - yyQ3)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    13Clone fragment #1 returns variables xxQ1, xxQ3 , while Clone fragment #2 returns variables yyQ1, yyQ3