tick = (ValueTick) iterator.next(); xx1 = valueToJava2D(tick.getValue() - 0.5d, dataArea, RectangleEdge.BOTTOM); xx2 = valueToJava2D(tick.getValue() + 0.5d, dataArea, RectangleEdge.BOTTOM); if (currentGridBandIsDark) { g2.setPaint(this.gridBandPaint); } else { g2.setPaint(Color.white); } band = new Rectangle2D.Double(xx1, yy + outlineStrokeWidth, xx2 - xx1, dataArea.getMaxY() - yy - outlineStrokeWidth); g2.fill(band); currentGridBandIsDark = !currentGridBandIsDark;
tick = (ValueTick) iterator.next(); yy1 = valueToJava2D(tick.getValue() + 0.5d, plotArea, RectangleEdge.LEFT); yy2 = valueToJava2D(tick.getValue() - 0.5d, plotArea, RectangleEdge.LEFT); if (currentGridBandIsDark) { g2.setPaint(this.gridBandPaint); } else { g2.setPaint(Color.white); } band = new Rectangle2D.Double(xx + outlineStrokeWidth, yy1, plotArea.getMaxX() - xx - outlineStrokeWidth, yy2 - yy1); g2.fill(band); currentGridBandIsDark = !currentGridBandIsDark;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/SymbolAxis.java File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/SymbolAxis.java
Method name: void drawGridBandsHorizontal(Graphics2D, Rectangle2D, Rectangle2D, boolean, List) Method name: void drawGridBandsVertical(Graphics2D, Rectangle2D, Rectangle2D, boolean, List)
Number of AST nodes: 9 Number of AST nodes: 9
1
tick = (ValueTick) iterator.next();
1
tick = (ValueTick) iterator.next();
2
            xx1 = valueToJava2D(tick.getValue() - 0.5d, dataArea, 
2
            yy1 = valueToJava2D(tick.getValue() + 0.5d, plotArea, 
3
                    RectangleEdge.BOTTOM);
3
                    RectangleEdge.LEFT);
4
            xx2 = valueToJava2D(tick.getValue() + 0.5d, dataArea, 
4
            yy2 = valueToJava2D(tick.getValue() - 0.5d, plotArea, 
5
                    RectangleEdge.BOTTOM);
5
                    RectangleEdge.LEFT);
6
            if (currentGridBandIsDark) {
6
            if (currentGridBandIsDark) {
7
                g2.setPaint(this.gridBandPaint);
7
                g2.setPaint(this.gridBandPaint);
8
            }
8
            }
9
            else {
9
            else {
10
                g2.setPaint(Color.white);
10
                g2.setPaint(Color.white);
11
            }
11
            }
12
            band = new Rectangle2D.Double(xx1, yy + outlineStrokeWidth, 
12
            band = new Rectangle2D.Double(xx + outlineStrokeWidth, yy1, 
13
                xx2 - xx1, dataArea.getMaxY() - yy - outlineStrokeWidth);
13
                    plotArea.getMaxX() - xx - outlineStrokeWidth, yy2 - yy1);
14
            g2.fill(band);
14
            g2.fill(band);
15
            currentGridBandIsDark = !currentGridBandIsDark;
15
            currentGridBandIsDark = !currentGridBandIsDark;
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.1
Clones locationClones are declared in the same class
Number of node comparisons46
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)42.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    12
    tick = (ValueTick)iterator.next();
    13
    tick = (ValueTick)iterator.next();
    13
    xx1 = valueToJava2D(tick.getValue() - 0.5d, dataArea, RectangleEdge.BOTTOM);
    13
    xx1 = valueToJava2D(tick.getValue() - 0.5d, dataArea, RectangleEdge.BOTTOM);
    15
    yy2 = valueToJava2D(tick.getValue() - 0.5d, plotArea, RectangleEdge.LEFT);
    Differences
    Expression1Expression2Difference
    xx1yy2VARIABLE_NAME_MISMATCH
    dataAreaplotAreaVARIABLE_NAME_MISMATCH
    BOTTOMLEFTVARIABLE_NAME_MISMATCH
    15
    yy2 = valueToJava2D(tick.getValue() - 0.5d, plotArea, RectangleEdge.LEFT);
    14
    xx2 = valueToJava2D(tick.getValue() + 0.5d, dataArea, RectangleEdge.BOTTOM);
    14
    xx2 = valueToJava2D(tick.getValue() + 0.5d, dataArea, RectangleEdge.BOTTOM);
    14
    yy1 = valueToJava2D(tick.getValue() + 0.5d, plotArea, RectangleEdge.LEFT);
    Differences
    Expression1Expression2Difference
    xx2yy1VARIABLE_NAME_MISMATCH
    dataAreaplotAreaVARIABLE_NAME_MISMATCH
    BOTTOMLEFTVARIABLE_NAME_MISMATCH
    14
    yy1 = valueToJava2D(tick.getValue() + 0.5d, plotArea, RectangleEdge.LEFT);
    15
    if (currentGridBandIsDark)
    16
    if (currentGridBandIsDark)
    16
    g2.setPaint(this.gridBandPaint);
    17
    g2.setPaint(this.gridBandPaint);
    else
    else
    17
    g2.setPaint(Color.white);
    18
    g2.setPaint(Color.white);
    18
    band = new Rectangle2D.Double(xx1, yy + outlineStrokeWidth, xx2 - xx1, dataArea.getMaxY() - yy - outlineStrokeWidth);
    18
    band = new Rectangle2D.Double(xx1, yy + outlineStrokeWidth, xx2 - xx1, dataArea.getMaxY() - yy - outlineStrokeWidth);
    19
    band = new Rectangle2D.Double(xx + outlineStrokeWidth, yy1, plotArea.getMaxX() - xx - outlineStrokeWidth, yy2 - yy1);
    Differences
    Expression1Expression2Difference
    xx1xx + outlineStrokeWidthTYPE_COMPATIBLE_REPLACEMENT
    yy + outlineStrokeWidthyy1TYPE_COMPATIBLE_REPLACEMENT
    xx2plotArea.getMaxX()TYPE_COMPATIBLE_REPLACEMENT
    xx1xxVARIABLE_NAME_MISMATCH
    xx2 - xx1plotArea.getMaxX() - xx - outlineStrokeWidthINFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    dataArea.getMaxY()yy2TYPE_COMPATIBLE_REPLACEMENT
    yyyy1VARIABLE_NAME_MISMATCH
    dataArea.getMaxY() - yy - outlineStrokeWidthyy2 - yy1INFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression xx1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yy1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xx2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xx1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression xx2 - xx1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yy2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yy1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression yy2 - yy1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    19
    band = new Rectangle2D.Double(xx + outlineStrokeWidth, yy1, plotArea.getMaxX() - xx - outlineStrokeWidth, yy2 - yy1);
    19
    g2.fill(band);
    20
    g2.fill(band);
    20
    currentGridBandIsDark = !currentGridBandIsDark;
    21
    currentGridBandIsDark = !currentGridBandIsDark;
    Precondition Violations (8)
    Row Violation
    1Expression xx1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression yy1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression xx2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression xx1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression xx2 - xx1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression yy2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression yy1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression yy2 - yy1 cannot be parameterized, because it has dependencies to/from statements that will be extracted