if (getDrawOpenTicks()) { double yOpen = hld.getOpenValue(series, item); if (!Double.isNaN(yOpen)) { double yyOpen = rangeAxis.valueToJava2D(yOpen, dataArea, location); if (this.openTickPaint != null) { g2.setPaint(this.openTickPaint); } else { g2.setPaint(itemPaint); } if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen, xx)); } else if (orientation == PlotOrientation.VERTICAL) { g2.draw(new Line2D.Double(xx - delta, yyOpen, xx, yyOpen)); } } }
if (getDrawCloseTicks()) { double yClose = hld.getCloseValue(series, item); if (!Double.isNaN(yClose)) { double yyClose = rangeAxis.valueToJava2D( yClose, dataArea, location); if (this.closeTickPaint != null) { g2.setPaint(this.closeTickPaint); } else { g2.setPaint(itemPaint); } if (orientation == PlotOrientation.HORIZONTAL) { g2.draw(new Line2D.Double(yyClose, xx, yyClose, xx - delta)); } else if (orientation == PlotOrientation.VERTICAL) { g2.draw(new Line2D.Double(xx, yyClose, xx + delta, yyClose)); } } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/HighLowRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/HighLowRenderer.java
Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int) Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
Number of AST nodes: 11 Number of AST nodes: 11
1
if (getDrawOpenTicks()) {
1
if (getDrawCloseTicks()) {
2
                double yOpen = hld.getOpenValue(series, item);
2
                double yClose = hld.getCloseValue(series, item);
3
                if (!Double.isNaN(yOpen)) {
3
                if (!Double.isNaN(yClose)) {
4
                    double yyOpen = rangeAxis.valueToJava2D(yOpen, dataArea,
4
                    double yyClose = rangeAxis.valueToJava2D(
5
                            location);
5
                        yClose, dataArea, location);
6
                    if (this.openTickPaint != null) {
6
                    if (this.closeTickPaint != null) {
7
                        g2.setPaint(this.openTickPaint);
7
                        g2.setPaint(this.closeTickPaint);
8
                    }
8
                    }
9
                    else {
9
                    else {
10
                        g2.setPaint(itemPaint);
10
                        g2.setPaint(itemPaint);
11
                    }
11
                    }
12
                    if (orientation == PlotOrientation.HORIZONTAL) {
12
                    if (orientation == PlotOrientation.HORIZONTAL) {
13
                        g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen,
13
                        g2.draw(new Line2D.Double(yyClose, xx, yyClose,
14
                                xx));
14
                                xx - delta));
15
                    }
15
                    }
16
                    else if (orientation == PlotOrientation.VERTICAL) {
16
                    else if (orientation == PlotOrientation.VERTICAL) {
17
                        g2.draw(new Line2D.Double(xx - delta, yyOpen, xx,
17
                        g2.draw(new Line2D.Double(xx, yyClose, xx + delta,
18
                                yyOpen));
18
                                yyClose));
19
                    }
19
                    }
20
                }
20
                }
21
            }
21
            }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.9
Clones locationClones are in the same method
Number of node comparisons45
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)13.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    31
    if (getDrawOpenTicks())
    31
    if (getDrawOpenTicks())
    42
    if (getDrawCloseTicks())
    Differences
    Expression1Expression2Difference
    getDrawOpenTicksgetDrawCloseTicksMETHOD_INVOCATION_NAME_MISMATCH
    42
    if (getDrawCloseTicks())
    32
    double yOpen = hld.getOpenValue(series, item);
    32
    double yOpen = hld.getOpenValue(series, item);
    43
    double yClose = hld.getCloseValue(series, item);
    Differences
    Expression1Expression2Difference
    yOpenyCloseVARIABLE_NAME_MISMATCH
    getOpenValuegetCloseValueMETHOD_INVOCATION_NAME_MISMATCH
    43
    double yClose = hld.getCloseValue(series, item);
    33
    if (!Double.isNaN(yOpen))
    33
    if (!Double.isNaN(yOpen))
    44
    if (!Double.isNaN(yClose))
    Differences
    Expression1Expression2Difference
    yOpenyCloseVARIABLE_NAME_MISMATCH
    44
    if (!Double.isNaN(yClose))
    34
    double yyOpen = rangeAxis.valueToJava2D(yOpen, dataArea, location);
    34
    double yyOpen = rangeAxis.valueToJava2D(yOpen, dataArea, location);
    45
    double yyClose = rangeAxis.valueToJava2D(yClose, dataArea, location);
    Differences
    Expression1Expression2Difference
    yyOpenyyCloseVARIABLE_NAME_MISMATCH
    yOpenyCloseVARIABLE_NAME_MISMATCH
    45
    double yyClose = rangeAxis.valueToJava2D(yClose, dataArea, location);
    35
    if (this.openTickPaint != null)
    35
    if (this.openTickPaint != null)
    46
    if (this.closeTickPaint != null)
    Differences
    Expression1Expression2Difference
    openTickPaintcloseTickPaintVARIABLE_NAME_MISMATCH
    46
    if (this.closeTickPaint != null)
    36
    g2.setPaint(this.openTickPaint);
    36
    g2.setPaint(this.openTickPaint);
    47
    g2.setPaint(this.closeTickPaint);
    Differences
    Expression1Expression2Difference
    openTickPaintcloseTickPaintVARIABLE_NAME_MISMATCH
    47
    g2.setPaint(this.closeTickPaint);
    else
    else
    37
    g2.setPaint(itemPaint);
    48
    g2.setPaint(itemPaint);
    38
    if (orientation == PlotOrientation.HORIZONTAL)
    49
    if (orientation == PlotOrientation.HORIZONTAL)
    39
    g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen, xx));
    39
    g2.draw(new Line2D.Double(yyOpen, xx + delta, yyOpen, xx));
    50
    g2.draw(new Line2D.Double(yyClose, xx, yyClose, xx - delta));
    Differences
    Expression1Expression2Difference
    yyOpenyyCloseVARIABLE_NAME_MISMATCH
    xx + deltaxxTYPE_COMPATIBLE_REPLACEMENT
    yyOpenyyCloseVARIABLE_NAME_MISMATCH
    xxxx - deltaTYPE_COMPATIBLE_REPLACEMENT
    50
    g2.draw(new Line2D.Double(yyClose, xx, yyClose, xx - delta));
    40
    else if (orientation == PlotOrientation.VERTICAL)
    51
    else if (orientation == PlotOrientation.VERTICAL)
    41
    g2.draw(new Line2D.Double(xx - delta, yyOpen, xx, yyOpen));
    41
    g2.draw(new Line2D.Double(xx - delta, yyOpen, xx, yyOpen));
    52
    g2.draw(new Line2D.Double(xx, yyClose, xx + delta, yyClose));
    Differences
    Expression1Expression2Difference
    xx - deltaxxTYPE_COMPATIBLE_REPLACEMENT
    yyOpenyyCloseVARIABLE_NAME_MISMATCH
    xxxx + deltaTYPE_COMPATIBLE_REPLACEMENT
    yyOpenyyCloseVARIABLE_NAME_MISMATCH
    52
    g2.draw(new Line2D.Double(xx, yyClose, xx + delta, yyClose));
    Precondition Violations (0)
    Row Violation