double xxMean = rangeAxis.valueToJava2D(xMean.doubleValue(), dataArea, location); aRadius = state.getBarWidth() / 4; // here we check that the average marker will in fact be visible // before drawing it... if ((xxMean > (dataArea.getMinX() - aRadius)) && (xxMean < (dataArea.getMaxX() + aRadius))) { Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xxMean - aRadius, yy + aRadius, aRadius * 2, aRadius * 2); g2.fill(avgEllipse); g2.draw(avgEllipse); }
yyAverage = rangeAxis.valueToJava2D(yMean.doubleValue(), dataArea, location); aRadius = state.getBarWidth() / 4; // here we check that the average marker will in fact be visible // before drawing it... if ((yyAverage > (dataArea.getMinY() - aRadius)) && (yyAverage < (dataArea.getMaxY() + aRadius))) { Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xx + aRadius, yyAverage - aRadius, aRadius * 2, aRadius * 2); g2.fill(avgEllipse); g2.draw(avgEllipse); }
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: 6 Number of AST nodes: 6
1
double xxMean = rangeAxis.valueToJava2D(xMean.doubleValue(),
1
yyAverage = rangeAxis.valueToJava2D(yMean.doubleValue(),
2
                    dataArea, location);
2
                    dataArea, location);
3
            aRadius = state.getBarWidth() / 4;
3
            aRadius = state.getBarWidth() / 4;
4
            // here we check that the average marker will in fact be visible
4
            // here we check that the average marker will in fact be visible
5
            // before drawing it...
5
            // before drawing it...
6
            if ((xxMean > (dataArea.getMinX() - aRadius))
6
            if ((yyAverage > (dataArea.getMinY() - aRadius))
7
                    && (xxMean < (dataArea.getMaxX() + aRadius))) {
7
                    && (yyAverage < (dataArea.getMaxY() + aRadius))) {
8
                Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xxMean
8
                Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xx + aRadius,
9
                        - aRadius, yy + aRadius, aRadius * 2, aRadius * 2);
9
                        yyAverage - aRadius, aRadius * 2, aRadius * 2);
10
                g2.fill(avgEllipse);
10
                g2.fill(avgEllipse);
11
                g2.draw(avgEllipse);
11
                g2.draw(avgEllipse);
12
            }
12
            }
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.6
Clones locationClones are declared in the same class
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)13.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    44
    double xxMean = rangeAxis.valueToJava2D(xMean.doubleValue(), dataArea, location);
    44
    double xxMean = rangeAxis.valueToJava2D(xMean.doubleValue(), dataArea, location);
    Preondition Violations
    Unmatched statement double xxMean=rangeAxis.valueToJava2D(xMean.doubleValue(),dataArea,location); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                                                      
                                                                                                                                                              
    47
    yyAverage = rangeAxis.valueToJava2D(yMean.doubleValue(), dataArea, location);
    Preondition Violations
    Unmatched statement yyAverage=rangeAxis.valueToJava2D(yMean.doubleValue(),dataArea,location); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    47
    yyAverage = rangeAxis.valueToJava2D(yMean.doubleValue(), dataArea, location);
    45
    aRadius = state.getBarWidth() / 4;
    48
    aRadius = state.getBarWidth() / 4;
    46
    if ((xxMean > (dataArea.getMinX() - aRadius)) && (xxMean < (dataArea.getMaxX() + aRadius)))
    46
    if ((xxMean > (dataArea.getMinX() - aRadius)) && (xxMean < (dataArea.getMaxX() + aRadius)))
    49
    if ((yyAverage > (dataArea.getMinY() - aRadius)) && (yyAverage < (dataArea.getMaxY() + aRadius)))
    Differences
    Expression1Expression2Difference
    xxMeanyyAverageVARIABLE_NAME_MISMATCH
    getMinXgetMinYMETHOD_INVOCATION_NAME_MISMATCH
    xxMeanyyAverageVARIABLE_NAME_MISMATCH
    getMaxXgetMaxYMETHOD_INVOCATION_NAME_MISMATCH
    49
    if ((yyAverage > (dataArea.getMinY() - aRadius)) && (yyAverage < (dataArea.getMaxY() + aRadius)))
    47
    Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xxMean - aRadius, yy + aRadius, aRadius * 2, aRadius * 2);
    47
    Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xxMean - aRadius, yy + aRadius, aRadius * 2, aRadius * 2);
    50
    Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xx + aRadius, yyAverage - aRadius, aRadius * 2, aRadius * 2);
    Differences
    Expression1Expression2Difference
    xxMeanxxVARIABLE_NAME_MISMATCH
    -+OPERATOR_MISMATCH
    yyyyAverageVARIABLE_NAME_MISMATCH
    +-OPERATOR_MISMATCH
    Preondition Violations
    Expression xxMean cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xxMean - aRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xx + aRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yyAverage cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yy + aRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yyAverage - aRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    50
    Ellipse2D.Double avgEllipse = new Ellipse2D.Double(xx + aRadius, yyAverage - aRadius, aRadius * 2, aRadius * 2);
    48
    g2.fill(avgEllipse);
    51
    g2.fill(avgEllipse);
    49
    g2.draw(avgEllipse);
    52
    g2.draw(avgEllipse);
    Precondition Violations (9)
    Row Violation
    1Unmatched statement double xxMean=rangeAxis.valueToJava2D(xMean.doubleValue(),dataArea,location); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement yyAverage=rangeAxis.valueToJava2D(yMean.doubleValue(),dataArea,location); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Expression xxMean cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression xxMean - aRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression xx + aRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression yyAverage cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression yy + aRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression yyAverage - aRadius cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Clone fragment #1 returns variables , while Clone fragment #2 returns variables aRadius