if (flag) { Plot plot = this.chart.getPlot(); if (plot instanceof Zoomable) { Zoomable z = (Zoomable) plot; this.rangeZoomable = flag && (z.isRangeZoomable()); } } else { this.rangeZoomable = false; }
if (flag) { Plot plot = this.chart.getPlot(); if (plot instanceof Zoomable) { Zoomable z = (Zoomable) plot; this.domainZoomable = flag && (z.isDomainZoomable()); } } else { this.domainZoomable = false; }
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/swt/org/jfree/experimental/chart/swt/ChartComposite.java
Method name: void setRangeZoomable(boolean) Method name: void setDomainZoomable(boolean)
Number of AST nodes: 6 Number of AST nodes: 6
1
if (flag) {
1
if (flag) {
2
            Plot plot = this.chart.getPlot();
2
            Plot plot = this.chart.getPlot();
3
            if (plot instanceof Zoomable) {
3
            if (plot instanceof Zoomable) {
4
                Zoomable z = (Zoomable) plot;
4
                Zoomable z = (Zoomable) plot;
5
                this.rangeZoomable = flag && (z.isRangeZoomable());
5
                this.domainZoomable = flag && (z.isDomainZoomable());  
6
            }
6
            }
7
        }
7
        }
8
        else {
8
        else {
9
            this.rangeZoomable = false;
9
            this.domainZoomable = false;
10
        }
10
        }
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.2
Clones locationClones are in different classes
Number of node comparisons18
  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)178.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (flag)
    1
    if (flag)
    2
    Plot plot = this.chart.getPlot();
    2
    Plot plot = this.chart.getPlot();
    3
    if (plot instanceof Zoomable)
    3
    if (plot instanceof Zoomable)
    4
    Zoomable z = (Zoomable)plot;
    4
    Zoomable z = (Zoomable)plot;
    5
    this.rangeZoomable = flag && (z.isRangeZoomable());
    5
    this.rangeZoomable = flag && (z.isRangeZoomable());
    5
    this.domainZoomable = flag && (z.isDomainZoomable());
    Differences
    Expression1Expression2Difference
    rangeZoomabledomainZoomableVARIABLE_NAME_MISMATCH
    isRangeZoomableisDomainZoomableMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.rangeZoomable is a field being modified, and thus it cannot be parameterized
    Expression this.domainZoomable is a field being modified, and thus it cannot be parameterized
    Expression z.isRangeZoomable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression z.isDomainZoomable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    this.domainZoomable = flag && (z.isDomainZoomable());
    else
    else
    6
    this.rangeZoomable = false;
    6
    this.rangeZoomable = false;
    6
    this.domainZoomable = false;
    Differences
    Expression1Expression2Difference
    rangeZoomabledomainZoomableVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression this.rangeZoomable is a field being modified, and thus it cannot be parameterized
    Expression this.domainZoomable is a field being modified, and thus it cannot be parameterized
    6
    this.domainZoomable = false;
    Precondition Violations (7)
    Row Violation
    1Expression this.rangeZoomable is a field being modified, and thus it cannot be parameterized
    2Expression this.domainZoomable is a field being modified, and thus it cannot be parameterized
    3Expression z.isRangeZoomable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression z.isDomainZoomable() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.rangeZoomable is a field being modified, and thus it cannot be parameterized
    6Expression this.domainZoomable is a field being modified, and thus it cannot be parameterized
    7The refactoring of the clones is infeasible, because classes org.jfree.chart.ChartPanel and org.jfree.experimental.chart.swt.ChartComposite do not have a common superclass