if (chart != null) { this.chart.addChangeListener(this); this.chart.addProgressListener(this); Plot plot = chart.getPlot(); this.domainZoomable = false; this.rangeZoomable = false; if (plot instanceof Zoomable) { Zoomable z = (Zoomable) plot; this.domainZoomable = z.isDomainZoomable(); this.rangeZoomable = z.isRangeZoomable(); this.orientation = z.getOrientation(); } } else { this.domainZoomable = false; this.rangeZoomable = false; }
if (chart != null) { this.chart.addChangeListener(this); this.chart.addProgressListener(this); Plot plot = chart.getPlot(); this.domainZoomable = false; this.rangeZoomable = false; if (plot instanceof Zoomable) { Zoomable z = (Zoomable) plot; this.domainZoomable = z.isDomainZoomable(); this.rangeZoomable = z.isRangeZoomable(); this.orientation = z.getOrientation(); } } else { this.domainZoomable = false; this.rangeZoomable = 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 setChart(JFreeChart) Method name: void setChart(JFreeChart)
Number of AST nodes: 13 Number of AST nodes: 13
1
if (chart != null) {
1
if (chart != null) {
2
            this.chart.addChangeListener(this);
2
            this.chart.addChangeListener(this);
3
            this.chart.addProgressListener(this);
3
            this.chart.addProgressListener(this);
4
            Plot plot = chart.getPlot();
4
            Plot plot = chart.getPlot();
5
            this.domainZoomable = false;
5
            this.domainZoomable = false;
6
            this.rangeZoomable = false;
6
            this.rangeZoomable = false;
7
            if (plot instanceof Zoomable) {
7
            if (plot instanceof Zoomable) {
8
                Zoomable z = (Zoomable) plot;
8
                Zoomable z = (Zoomable) plot;
9
                this.domainZoomable = z.isDomainZoomable();
9
                this.domainZoomable = z.isDomainZoomable();
10
                this.rangeZoomable = z.isRangeZoomable();
10
                this.rangeZoomable = z.isRangeZoomable();
11
                this.orientation = z.getOrientation();
11
                this.orientation = z.getOrientation();
12
            }
12
            }
13
        }
13
        }
14
        else {
14
        else {
15
            this.domainZoomable = false;
15
            this.domainZoomable = false;
16
            this.rangeZoomable = false;
16
            this.rangeZoomable = false;
17
        }
17
        }
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 comparisons89
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements13
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)53.1
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    5
    if (chart != null)
    5
    if (chart != null)
    6
    this.chart.addChangeListener(this);
    6
    this.chart.addChangeListener(this);
    7
    this.chart.addProgressListener(this);
    7
    this.chart.addProgressListener(this);
    8
    Plot plot = chart.getPlot();
    8
    Plot plot = chart.getPlot();
    9
    this.domainZoomable = false;
    9
    this.domainZoomable = false;
    10
    this.rangeZoomable = false;
    10
    this.rangeZoomable = false;
    11
    if (plot instanceof Zoomable)
    11
    if (plot instanceof Zoomable)
    12
    Zoomable z = (Zoomable)plot;
    12
    Zoomable z = (Zoomable)plot;
    13
    this.domainZoomable = z.isDomainZoomable();
    13
    this.domainZoomable = z.isDomainZoomable();
    14
    this.rangeZoomable = z.isRangeZoomable();
    14
    this.rangeZoomable = z.isRangeZoomable();
    15
    this.orientation = z.getOrientation();
    15
    this.orientation = z.getOrientation();
    else
    else
    16
    this.domainZoomable = false;
    16
    this.domainZoomable = false;
    17
    this.rangeZoomable = false;
    17
    this.rangeZoomable = false;
    Precondition Violations (1)
    Row Violation
    1The 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