File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/AbstractRenderer.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java | |||
Method name: ItemLabelPosition getSeriesNegativeItemLabelPosition(int)
|
Method name: XYItemLabelGenerator getItemLabelGenerator(int, int)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (this.negativeItemLabelPosition != null) {↵ | 1 | if (this.itemLabelGenerator != null) {↵ | |
2 | return this.negativeItemLabelPosition;↵ | 2 | return this.itemLabelGenerator;↵ | |
3 | }↵ | 3 | }↵ | |
4 | // otherwise look up the position list↵ | 4 | // otherwise look up the generator table↵ | |
5 | ItemLabelPosition position = (ItemLabelPosition)↵ | 5 | XYItemLabel↵ | |
6 | this.negativeItemLabelPosition↵ | 6 | Generator generator↵ | |
7 | List.get(series);↵ | 7 | = (XYItemLabelGenerator) this.itemLabelGeneratorList.get(series);↵ | |
8 | if (position == null) {↵ | 8 | if (generator == null) {↵ | |
9 | position = this.baseNegativeItemLabelPosition;↵ | 9 | generator = this.baseItemLabelGenerator;↵ | |
10 | }↵ | 10 | }↵ | |
11 | return position; | 11 | return generator; | |
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.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 14 |
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 1.5 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this.negativeItemLabelPosition != null) |
| 1 | if (this.itemLabelGenerator != null) | ||||||||||||||
|
| 2 | return this.itemLabelGenerator; | |||||||||||||||
2 | return this.negativeItemLabelPosition; |
| | |||||||||||||||
| 3 | XYItemLabelGenerator generator = (XYItemLabelGenerator)this.itemLabelGeneratorList.get(series); | ||||||||||||||||
3 | ItemLabelPosition position = (ItemLabelPosition)this.negativeItemLabelPositionList.get(series); | | ||||||||||||||||
4 | if (position == null) |
| 4 | if (generator == null) | ||||||||||||||
|
| 5 | generator = this.baseItemLabelGenerator; | |||||||||||||||
5 | position = this.baseNegativeItemLabelPosition; |
| | |||||||||||||||
|
| 6 | return generator; | |||||||||||||||
6 | return position; |
| |
Row | Violation |
---|---|
1 | Type org.jfree.chart.labels.ItemLabelPosition of variable this.negativeItemLabelPosition does not match with type org.jfree.chart.labels.XYItemLabelGenerator of variable this.itemLabelGenerator |
2 | Unmatched statement return this.itemLabelGenerator; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched return this.itemLabelGenerator; |
4 | Unmatched statement return this.negativeItemLabelPosition; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched return this.negativeItemLabelPosition; |
6 | Type org.jfree.chart.labels.ItemLabelPosition of variable position does not match with type org.jfree.chart.labels.XYItemLabelGenerator of variable generator |
7 | Unmatched statement generator=this.baseItemLabelGenerator; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement position=this.baseNegativeItemLabelPosition; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Unmatched return generator; |
10 | Unmatched return position; |
11 | The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero |