ValueAxis existing = getDomainAxis(index); if (existing != null) { existing.removeChangeListener(this); } if (axis != null) { axis.setPlot(this); } this.domainAxes.set(index, axis); if (axis != null) { axis.configure(); axis.addChangeListener(this); } if (notify) { fireChangeEvent(); }
ValueAxis existing = getRangeAxis(index); if (existing != null) { existing.removeChangeListener(this); } if (axis != null) { axis.setPlot(this); } this.rangeAxes.set(index, axis); if (axis != null) { axis.configure(); axis.addChangeListener(this); } if (notify) { fireChangeEvent(); }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: void setDomainAxis(int, ValueAxis, boolean) Method name: void setRangeAxis(int, ValueAxis, boolean)
Number of AST nodes: 11 Number of AST nodes: 11
1
ValueAxis existing = getDomainAxis(index);
1
ValueAxis existing = getRangeAxis(index);
2
        if (existing != null) {
2
        if (existing != null) {
3
            existing.removeChangeListener(this);
3
            existing.removeChangeListener(this);
4
        }
4
        }
5
        if (axis != null) {
5
        if (axis != null) {
6
            axis.setPlot(this);
6
            axis.setPlot(this);
7
        }
7
        }
8
        this.domainAxes.set(index, axis);
8
        this.rangeAxes.set(index, axis);
9
        if (axis != null) {
9
        if (axis != null) {
10
            axis.configure();
10
            axis.configure();
11
            axis.addChangeListener(this);
11
            axis.addChangeListener(this);
12
        }
12
        }
13
        if (notify) {
13
        if (notify) {
14
            fireChangeEvent();
14
            fireChangeEvent();
15
        }
15
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)4.9
Clones locationClones are declared in the same class
Number of node comparisons50
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)751.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    ValueAxis existing = getDomainAxis(index);
    1
    ValueAxis existing = getDomainAxis(index);
    1
    ValueAxis existing = getRangeAxis(index);
    Differences
    Expression1Expression2Difference
    getDomainAxisgetRangeAxisMETHOD_INVOCATION_NAME_MISMATCH
    1
    ValueAxis existing = getRangeAxis(index);
    2
    if (existing != null)
    2
    if (existing != null)
    3
    existing.removeChangeListener(this);
    3
    existing.removeChangeListener(this);
    4
    if (axis != null)
    4
    if (axis != null)
    5
    axis.setPlot(this);
    5
    axis.setPlot(this);
    6
    this.domainAxes.set(index, axis);
    6
    this.domainAxes.set(index, axis);
    6
    this.rangeAxes.set(index, axis);
    Differences
    Expression1Expression2Difference
    domainAxesrangeAxesVARIABLE_NAME_MISMATCH
    6
    this.rangeAxes.set(index, axis);
    7
    if (axis != null)
    7
    if (axis != null)
    8
    axis.configure();
    8
    axis.configure();
    9
    axis.addChangeListener(this);
    9
    axis.addChangeListener(this);
    10
    if (notify)
    10
    if (notify)
    11
    fireChangeEvent();
    11
    fireChangeEvent();
    Precondition Violations (0)
    Row Violation