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.4
Clones locationClones are declared in the same class
Number of node comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)2.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    44
    double xxMean = rangeAxis.valueToJava2D(xMean.doubleValue(), dataArea, location);
                                                                                                                                                                      
                                                                                                                                                              
    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);
    Preondition Violations
    Unmatched statement Ellipse2D.Double avgEllipse=new Ellipse2D.Double(xxMean - aRadius,yy + aRadius,aRadius * 2,aRadius * 2); cannot be moved before or after the extracted code, 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);
    Preondition Violations
    Unmatched statement Ellipse2D.Double avgEllipse=new Ellipse2D.Double(xx + aRadius,yyAverage - aRadius,aRadius * 2,aRadius * 2); cannot be moved before or after the extracted code, 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 (2)
    Row Violation
    1Unmatched statement Ellipse2D.Double avgEllipse=new Ellipse2D.Double(xxMean - aRadius,yy + aRadius,aRadius * 2,aRadius * 2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    2Unmatched statement Ellipse2D.Double avgEllipse=new Ellipse2D.Double(xx + aRadius,yyAverage - aRadius,aRadius * 2,aRadius * 2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted