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: 20 | Number of AST nodes: 19 | |||
1 | if (this.chart != null) { ↵ | 1 | if (this.chart != null) {↵ | |
2 | this.chart.removeChangeListener(this); ↵ | 2 | this.chart.removeChangeListener(this);↵ | |
3 | this.chart.removeProgressListener(this); ↵ | 3 | this.chart.removeProgressListener(this);↵ | |
4 | }↵ | 4 | }↵ | |
5 | ↵ | |||
6 | // add the new chart ↵ | 5 | // add the new chart↵ | |
7 | this.chart = chart; ↵ | 6 | this.chart = chart;↵ | |
8 | if (chart != null) { ↵ | 7 | if (chart != null) {↵ | |
9 | this.chart.addChangeListener(this); ↵ | 8 | this.chart.addChangeListener(this);↵ | |
10 | this.chart.addProgressListener(this); ↵ | 9 | this.chart.addProgressListener(this);↵ | |
11 | Plot plot = chart.getPlot(); ↵ | 10 | Plot plot = chart.getPlot();↵ | |
12 | this.domainZoomable = false; ↵ | 11 | this.domainZoomable = false;↵ | |
13 | this.rangeZoomable = false; ↵ | 12 | this.rangeZoomable = false;↵ | |
14 | if (plot instanceof Zoomable) { ↵ | 13 | if (plot instanceof Zoomable) {↵ | |
15 | Zoomable z = (Zoomable) plot; ↵ | 14 | Zoomable z = (Zoomable) plot;↵ | |
16 | this.domainZoomable = z.isDomainZoomable(); ↵ | 15 | this.domainZoomable = z.isDomainZoomable();↵ | |
17 | this.rangeZoomable = z.isRangeZoomable(); ↵ | 16 | this.rangeZoomable = z.isRangeZoomable();↵ | |
18 | this.orientation = z.getOrientation(); ↵ | 17 | this.orientation = z.getOrientation();↵ | |
19 | } ↵ | 18 | }↵ | |
20 | } ↵ | 19 | }↵ | |
21 | else { ↵ | 20 | else {↵ | |
22 | this.domainZoomable = false; ↵ | 21 | this.domainZoomable = false;↵ | |
23 | this.rangeZoomable = false; ↵ | 22 | this.rangeZoomable = false;↵ | |
24 | } ↵ | 23 | }↵ | |
25 | if (this.useBuffer) { ↵ | 24 | if (this.useBuffer) {↵ | |
26 | this.refreshBuffer = true; ↵ | 25 | this.refreshBuffer = true;↵ | |
27 | }↵ | 26 |
| |
28 | repaint(); | |||
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 1.0 |
Clones location | Clones are in different classes |
Number of node comparisons | 105 |
Number of mapped statements | 19 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 57.8 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |
---|---|---|---|---|
1 | if (this.chart != null) | 1 | if (this.chart != null) | |
2 | this.chart.removeChangeListener(this); | 2 | this.chart.removeChangeListener(this); | |
3 | this.chart.removeProgressListener(this); | 3 | this.chart.removeProgressListener(this); | |
4 | this.chart = chart; | 4 | this.chart = chart; | |
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; | |
18 | if (this.useBuffer) | 18 | if (this.useBuffer) | |
19 | this.refreshBuffer = true; | 19 | this.refreshBuffer = true; | |
20 | repaint(); | |
Row | Violation |
---|---|
1 | The 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 |