if (yyQ1Median < yyQ3Median) { box = new Rectangle2D.Double(yyQ1Median, xx - width / 2, yyQ3Median - yyQ1Median, width); } else { box = new Rectangle2D.Double(yyQ3Median, xx - width / 2, yyQ1Median - yyQ3Median, width); }
if (yyQ1Median > yyQ3Median) { box = new Rectangle2D.Double(xx - width / 2, yyQ3Median, width, yyQ1Median - yyQ3Median); } else { box = new Rectangle2D.Double(xx - width / 2, yyQ1Median, width, yyQ3Median - yyQ1Median); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBoxAndWhiskerRenderer.java File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYBoxAndWhiskerRenderer.java
Method name: void drawHorizontalItem(Graphics2D, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int) Method name: void drawVerticalItem(Graphics2D, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (yyQ1Median &lt; yyQ3Median) {
1
if (yyQ1Median &gt; yyQ3Median) {
2
            box = new Rectangle2D.Double(yyQ1Median, xx - width / 2, 
2
            box = new Rectangle2D.Double(xx - width / 2, yyQ3Median, width, 
3
                    yyQ3Median - yyQ1Median, width);
3
                    yyQ1Median - yyQ3Median);
4
        }
4
        }
5
        else {
5
        else {
6
            box = new Rectangle2D.Double(yyQ3Median, xx - width / 2, 
6
            box = new Rectangle2D.Double(xx - width / 2, yyQ1Median, width, 
7
                    yyQ1Median - yyQ3Median, width);
7
                    yyQ3Median - yyQ1Median);
8
        }
8
        }
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.2
Clones locationClones are declared in the same class
Number of node comparisons9
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)14.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    43
    if (yyQ1Median < yyQ3Median)
    43
    if (yyQ1Median < yyQ3Median)
    45
    if (yyQ1Median > yyQ3Median)
    Differences
    Expression1Expression2Difference
    <>OPERATOR_MISMATCH
    45
    if (yyQ1Median > yyQ3Median)
    44
    box = new Rectangle2D.Double(yyQ1Median, xx - width / 2, yyQ3Median - yyQ1Median, width);
    44
    box = new Rectangle2D.Double(yyQ1Median, xx - width / 2, yyQ3Median - yyQ1Median, width);
    46
    box = new Rectangle2D.Double(xx - width / 2, yyQ3Median, width, yyQ1Median - yyQ3Median);
    Differences
    Expression1Expression2Difference
    yyQ1Medianxx - width / 2TYPE_COMPATIBLE_REPLACEMENT
    xx - width / 2yyQ3MedianTYPE_COMPATIBLE_REPLACEMENT
    yyQ3Median - yyQ1MedianwidthTYPE_COMPATIBLE_REPLACEMENT
    widthyyQ1Median - yyQ3MedianTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression yyQ3Median - yyQ1Median cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yyQ1Median - yyQ3Median cannot be parameterized, because it has dependencies to/from statements that will be extracted
    46
    box = new Rectangle2D.Double(xx - width / 2, yyQ3Median, width, yyQ1Median - yyQ3Median);
    else
    else
    45
    box = new Rectangle2D.Double(yyQ3Median, xx - width / 2, yyQ1Median - yyQ3Median, width);
    45
    box = new Rectangle2D.Double(yyQ3Median, xx - width / 2, yyQ1Median - yyQ3Median, width);
    47
    box = new Rectangle2D.Double(xx - width / 2, yyQ1Median, width, yyQ3Median - yyQ1Median);
    Differences
    Expression1Expression2Difference
    yyQ3Medianxx - width / 2TYPE_COMPATIBLE_REPLACEMENT
    xx - width / 2yyQ1MedianTYPE_COMPATIBLE_REPLACEMENT
    yyQ1Median - yyQ3MedianwidthTYPE_COMPATIBLE_REPLACEMENT
    widthyyQ3Median - yyQ1MedianTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression yyQ1Median - yyQ3Median cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yyQ3Median - yyQ1Median cannot be parameterized, because it has dependencies to/from statements that will be extracted
    47
    box = new Rectangle2D.Double(xx - width / 2, yyQ1Median, width, yyQ3Median - yyQ1Median);
    Precondition Violations (4)
    Row Violation
    1Expression yyQ3Median - yyQ1Median cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression yyQ1Median - yyQ3Median cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression yyQ1Median - yyQ3Median cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression yyQ3Median - yyQ1Median cannot be parameterized, because it has dependencies to/from statements that will be extracted