File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/AbstractCategoryItemRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java | |||
Method name: LegendItemCollection getLegendItems()
|
Method name: LegendItemCollection getLegendItems()
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | if (this.plot == null) {↵ | 1 | if (this.plot == null) {↵ | |
2 | return new LegendItemCollection();↵ | 2 | return new LegendItemCollection();↵ | |
3 | }↵ | 3 | }↵ | |
4 | LegendItemCollection result = new LegendItemCollection();↵ | 4 | LegendItemCollection result = new LegendItemCollection();↵ | |
5 | int index = this.plot.getIndexOf(this);↵ | 5 | int index = this.plot.getIndexOf(this);↵ | |
6 | CategoryDataset dataset = this.plot.getDataset(index);↵ | 6 | XYDataset dataset = this.plot.getDataset(index);↵ | |
7 | if (dataset != null) {↵ | 7 | if (dataset != null) {↵ | |
8 | int seriesCount = dataset.getRowCount();↵ | 8 | int seriesCount = dataset.getSeriesCount();↵ | |
9 | for (int i = 0; i < seriesCount; i++) {↵ | 9 | for (int i = 0; i < seriesCount; i++) {↵ | |
10 | if (isSeriesVisibleInLegend(i)) {↵ | 10 | if (isSeriesVisibleInLegend(i)) {↵ | |
11 | LegendItem item = getLegendItem(index, i);↵ | 11 | LegendItem item = getLegendItem(index, i);↵ | |
12 | if (item != null) {↵ | 12 | if (item != null) {↵ | |
13 | result.add(item);↵ | 13 | result.add(item);↵ | |
14 | }↵ | 14 | }↵ | |
15 | }↵ | 15 | }↵ | |
16 | }↵ | 16 | }↵ | |
17 | }↵ | 17 | }↵ | |
18 | return result; | 18 |
| |
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) | 0.8 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 27 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 34.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this.plot == null) |
| 1 | if (this.plot == null) | |||||||||||||||||
2 | return new LegendItemCollection(); | 2 | return new LegendItemCollection(); | ||||||||||||||||||
3 | LegendItemCollection result = new LegendItemCollection(); | 3 | LegendItemCollection result = new LegendItemCollection(); | ||||||||||||||||||
4 | int index = this.plot.getIndexOf(this); |
| 4 | int index = this.plot.getIndexOf(this); | |||||||||||||||||
5 | CategoryDataset dataset = this.plot.getDataset(index); |
| 5 | XYDataset dataset = this.plot.getDataset(index); | |||||||||||||||||
6 | if (dataset != null) |
| 6 | if (dataset != null) | |||||||||||||||||
7 | int seriesCount = dataset.getRowCount(); |
| 7 | int seriesCount = dataset.getSeriesCount(); | |||||||||||||||||
8 | for (int i = 0; i < seriesCount; i++) | 8 | for (int i = 0; i < seriesCount; i++) | ||||||||||||||||||
9 | if (isSeriesVisibleInLegend(i)) | 9 | if (isSeriesVisibleInLegend(i)) | ||||||||||||||||||
10 | LegendItem item = getLegendItem(index, i); | 10 | LegendItem item = getLegendItem(index, i); | ||||||||||||||||||
11 | if (item != null) | 11 | if (item != null) | ||||||||||||||||||
12 | result.add(item); | 12 | result.add(item); | ||||||||||||||||||
13 | return result; | 13 | return result; |
Row | Violation |
---|---|
1 | Expression this.plot cannot be unified with expression this.plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public int getIndexOf(org.jfree.chart.renderer.category.CategoryItemRenderer) , public int getIndexOf(org.jfree.chart.renderer.xy.XYItemRenderer) |
2 | Expression this.plot cannot be unified with expression this.plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public org.jfree.data.category.CategoryDataset getDataset(int) , public org.jfree.data.xy.XYDataset getDataset(int) |
3 | Expression dataset.getRowCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression dataset.getSeriesCount() cannot be parameterized, because it has dependencies to/from statements that will be extracted |