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 getSeriesPositiveItemLabelPosition(int)
|
Method name: XYToolTipGenerator getToolTipGenerator(int, int)
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | if (this.positiveItemLabelPosition != null) {↵ | 1 | if (this.toolTipGenerator != null) {↵ | |
2 | return this.positiveItemLabelPosition;↵ | 2 | return this.toolTipGenerator;↵ | |
3 | }↵ | 3 | }↵ | |
4 | // otherwise look up the position table↵ | 4 | // otherwise look up the generator table↵ | |
5 | ItemLabelPosition position = (ItemLabelPosition)↵ | 5 | ↵ | |
6 | this.positiveItemLabelPosition↵ | 6 | XYToolTipGenerator generator↵ | |
7 | List.get(series);↵ | 7 | = (XYToolTipGenerator) this.toolTipGeneratorList.get(series);↵ | |
8 | if (position == null) {↵ | 8 | if (generator == null) {↵ | |
9 | position = this.basePositiveItemLabelPosition;↵ | 9 | generator = this.baseToolTipGenerator;↵ | |
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.positiveItemLabelPosition != null) |
| 1 | if (this.toolTipGenerator != null) | ||||||||||||||
|
| 2 | return this.toolTipGenerator; | |||||||||||||||
2 | return this.positiveItemLabelPosition; |
| | |||||||||||||||
| 3 | XYToolTipGenerator generator = (XYToolTipGenerator)this.toolTipGeneratorList.get(series); | ||||||||||||||||
3 | ItemLabelPosition position = (ItemLabelPosition)this.positiveItemLabelPositionList.get(series); | | ||||||||||||||||
4 | if (position == null) |
| 4 | if (generator == null) | ||||||||||||||
|
| 5 | generator = this.baseToolTipGenerator; | |||||||||||||||
5 | position = this.basePositiveItemLabelPosition; |
| | |||||||||||||||
|
| 6 | return generator; | |||||||||||||||
6 | return position; |
| |
Row | Violation |
---|---|
1 | Type org.jfree.chart.labels.ItemLabelPosition of variable this.positiveItemLabelPosition does not match with type org.jfree.chart.labels.XYToolTipGenerator of variable this.toolTipGenerator |
2 | Unmatched statement return this.toolTipGenerator; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched return this.toolTipGenerator; |
4 | Unmatched statement return this.positiveItemLabelPosition; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
5 | Unmatched return this.positiveItemLabelPosition; |
6 | Type org.jfree.chart.labels.ItemLabelPosition of variable position does not match with type org.jfree.chart.labels.XYToolTipGenerator of variable generator |
7 | Unmatched statement generator=this.baseToolTipGenerator; 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.basePositiveItemLabelPosition; 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 |