if (((int) dataArea.getMinX() < x) && (x < (int) dataArea.getMaxX())) { if (this.verticalTraceLine != null) { g2.draw(this.verticalTraceLine); this.verticalTraceLine.setLine(x, (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()); } else { this.verticalTraceLine = new Line2D.Float(x, (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()); } g2.draw(this.verticalTraceLine); }
if (((int) dataArea.getMinY() < y) && (y < (int) dataArea.getMaxY())) { if (this.horizontalTraceLine != null) { g2.draw(this.horizontalTraceLine); this.horizontalTraceLine.setLine((int) dataArea.getMinX(), y, (int) dataArea.getMaxX(), y); } else { this.horizontalTraceLine = new Line2D.Float( (int) dataArea.getMinX(), y, (int) dataArea.getMaxX(), y); } g2.draw(this.horizontalTraceLine); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java
Method name: void drawHorizontalAxisTrace(Graphics2D, int) Method name: void drawVerticalAxisTrace(Graphics2D, int)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (((int) dataArea.getMinX() < x) && (x < (int) dataArea.getMaxX())) {
1
if (((int) dataArea.getMinY() < y) && (y < (int) dataArea.getMaxY())) {
2
            if (this.verticalTraceLine != null) {
2
            if (this.horizontalTraceLine != null) {
3
                g2.draw(this.verticalTraceLine);
3
                g2.draw(this.horizontalTraceLine);
4
                this.verticalTraceLine.setLine(x, (int) dataArea.getMinY(), x,
4
                this.horizontalTraceLine.setLine((int) dataArea.getMinX(), y,
5
                        (int) dataArea.getMaxY());
5
                        (int) dataArea.getMaxX(), y);
6
            }
6
            }
7
            else {
7
            else {
8
                this.verticalTraceLine = new Line2D.Float(x,
8
                this.horizontalTraceLine = new Line2D.Float(
9
                        (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()
9
                        (int) dataArea.getMinX(), y, (int) dataArea.getMaxX(),
10
);
10
                        y);
11
            }
11
            }
12
            g2.draw(this.verticalTraceLine);
12
            g2.draw(this.horizontalTraceLine);
13
        }
13
        }
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.7
Clones locationClones are declared in the same class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)8.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (((int)dataArea.getMinX() < x) && (x < (int)dataArea.getMaxX()))
    3
    if (((int)dataArea.getMinX() < x) && (x < (int)dataArea.getMaxX()))
    3
    if (((int)dataArea.getMinY() < y) && (y < (int)dataArea.getMaxY()))
    Differences
    Expression1Expression2Difference
    getMinXgetMinYMETHOD_INVOCATION_NAME_MISMATCH
    xyVARIABLE_NAME_MISMATCH
    xyVARIABLE_NAME_MISMATCH
    getMaxXgetMaxYMETHOD_INVOCATION_NAME_MISMATCH
    3
    if (((int)dataArea.getMinY() < y) && (y < (int)dataArea.getMaxY()))
    4
    if (this.verticalTraceLine != null)
    4
    if (this.verticalTraceLine != null)
    4
    if (this.horizontalTraceLine != null)
    Differences
    Expression1Expression2Difference
    verticalTraceLinehorizontalTraceLineVARIABLE_NAME_MISMATCH
    4
    if (this.horizontalTraceLine != null)
    5
    g2.draw(this.verticalTraceLine);
    5
    g2.draw(this.verticalTraceLine);
    5
    g2.draw(this.horizontalTraceLine);
    Differences
    Expression1Expression2Difference
    verticalTraceLinehorizontalTraceLineVARIABLE_NAME_MISMATCH
    5
    g2.draw(this.horizontalTraceLine);
    6
    this.verticalTraceLine.setLine(x, (int)dataArea.getMinY(), x, (int)dataArea.getMaxY());
    6
    this.verticalTraceLine.setLine(x, (int)dataArea.getMinY(), x, (int)dataArea.getMaxY());
    6
    this.horizontalTraceLine.setLine((int)dataArea.getMinX(), y, (int)dataArea.getMaxX(), y);
    Differences
    Expression1Expression2Difference
    x(int)dataArea.getMinX()TYPE_COMPATIBLE_REPLACEMENT
    (int)dataArea.getMinY()yTYPE_COMPATIBLE_REPLACEMENT
    x(int)dataArea.getMaxX()TYPE_COMPATIBLE_REPLACEMENT
    (int)dataArea.getMaxY()yTYPE_COMPATIBLE_REPLACEMENT
    verticalTraceLinehorizontalTraceLineVARIABLE_NAME_MISMATCH
    6
    this.horizontalTraceLine.setLine((int)dataArea.getMinX(), y, (int)dataArea.getMaxX(), y);
    else
    else
    7
    this.verticalTraceLine = new Line2D.Float(x, (int)dataArea.getMinY(), x, (int)dataArea.getMaxY());
    7
    this.verticalTraceLine = new Line2D.Float(x, (int)dataArea.getMinY(), x, (int)dataArea.getMaxY());
    7
    this.horizontalTraceLine = new Line2D.Float((int)dataArea.getMinX(), y, (int)dataArea.getMaxX(), y);
    Differences
    Expression1Expression2Difference
    verticalTraceLinehorizontalTraceLineVARIABLE_NAME_MISMATCH
    x(int)dataArea.getMinX()TYPE_COMPATIBLE_REPLACEMENT
    (int)dataArea.getMinY()yTYPE_COMPATIBLE_REPLACEMENT
    x(int)dataArea.getMaxX()TYPE_COMPATIBLE_REPLACEMENT
    (int)dataArea.getMaxY()yTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.verticalTraceLine is a field being modified, and thus it cannot be parameterized
    Expression this.horizontalTraceLine is a field being modified, and thus it cannot be parameterized
    7
    this.horizontalTraceLine = new Line2D.Float((int)dataArea.getMinX(), y, (int)dataArea.getMaxX(), y);
    8
    g2.draw(this.verticalTraceLine);
    8
    g2.draw(this.verticalTraceLine);
    8
    g2.draw(this.horizontalTraceLine);
    Differences
    Expression1Expression2Difference
    verticalTraceLinehorizontalTraceLineVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.verticalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.horizontalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    g2.draw(this.horizontalTraceLine);
    Precondition Violations (4)
    Row Violation
    1Expression this.verticalTraceLine is a field being modified, and thus it cannot be parameterized
    2Expression this.horizontalTraceLine is a field being modified, and thus it cannot be parameterized
    3Expression this.verticalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.horizontalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted