Rectangle2D dataArea = getScreenDataArea(); g2.setXORMode(Color.orange); 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); } // Reset to the default 'overwrite' mode g2.setPaintMode();
Rectangle2D dataArea = getScreenDataArea(); g2.setXORMode(Color.orange); 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); } // Reset to the default 'overwrite' mode g2.setPaintMode();
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: 9 Number of AST nodes: 9
1
Rectangle2D dataArea = getScreenDataArea();
1
Rectangle2D dataArea = getScreenDataArea();
2
        g2.setXORMode(Color.orange);
2
        g2.setXORMode(Color.orange);
3
        if (((int) dataArea.getMinX() < x) && (x < (int) dataArea.getMaxX())) {
3
        if (((int) dataArea.getMinY() < y) && (y < (int) dataArea.getMaxY())) {
4
            if (this.verticalTraceLine != null) {
4
            if (this.horizontalTraceLine != null) {
5
                g2.draw(this.verticalTraceLine);
5
                g2.draw(this.horizontalTraceLine);
6
                this.verticalTraceLine.setLine(x, (int) dataArea.getMinY(), x,
6
                this.horizontalTraceLine.setLine((int) dataArea.getMinX(), y,
7
                        (int) dataArea.getMaxY());
7
                        (int) dataArea.getMaxX(), y);
8
            }
8
            }
9
            else {
9
            else {
10
                this.verticalTraceLine = new Line2D.Float(x,
10
                this.horizontalTraceLine = new Line2D.Float(
11
                        (int) dataArea.getMinY(), x, (int) dataArea.getMaxY()
11
                        (int) dataArea.getMinX(), y, (int) dataArea.getMaxX(),
12
);
12
                        y);
13
            }
13
            }
14
            g2.draw(this.verticalTraceLine);
14
            g2.draw(this.horizontalTraceLine);
15
        }
15
        }
16
        // Reset to the default 'overwrite' mode
16
        // Reset to the default 'overwrite' mode
17
        g2.setPaintMode();
17
        g2.setPaintMode();
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 comparisons29
  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)9.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Rectangle2D dataArea = getScreenDataArea();
    1
    Rectangle2D dataArea = getScreenDataArea();
    2
    g2.setXORMode(Color.orange);
    2
    g2.setXORMode(Color.orange);
    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
    Preondition Violations
    Expression dataArea.getMinX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataArea.getMinY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataArea.getMaxX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression dataArea.getMaxY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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
    Preondition Violations
    Expression (int)dataArea.getMinX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (int)dataArea.getMinY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (int)dataArea.getMaxX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (int)dataArea.getMaxY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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 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
    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
    Expression (int)dataArea.getMinX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (int)dataArea.getMinY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (int)dataArea.getMaxX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (int)dataArea.getMaxY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    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);
    9
    g2.setPaintMode();
    9
    g2.setPaintMode();
    Precondition Violations (18)
    Row Violation
    1Expression dataArea.getMinX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression dataArea.getMinY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression dataArea.getMaxX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression dataArea.getMaxY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression (int)dataArea.getMinX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression (int)dataArea.getMinY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression (int)dataArea.getMaxX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression (int)dataArea.getMaxY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression this.verticalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression this.horizontalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression this.verticalTraceLine is a field being modified, and thus it cannot be parameterized
    12Expression this.horizontalTraceLine is a field being modified, and thus it cannot be parameterized
    13Expression (int)dataArea.getMinX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression (int)dataArea.getMinY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression (int)dataArea.getMaxX() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression (int)dataArea.getMaxY() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression this.verticalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression this.horizontalTraceLine cannot be parameterized, because it has dependencies to/from statements that will be extracted