File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/RingPlot.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/HighLowRenderer.java | |||
Method name: void drawItem(Graphics2D, int, Rectangle2D, PiePlotState, int)
|
Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 10 | |||
1 | if (entities != null) {↵ | 1 | if (entities != null) {↵ | |
2 | String tip = null;↵ | 2 | String tip = null;↵ | |
3 | PieToolTipGenerator toolTipGenerator ↵ | 3 | XYToolTipGenerator generator ↵ | |
4 | = getToolTipGenerator();↵ | 4 | = getToolTipGenerator(series, item);↵ | |
5 | if (toolTipGenerator != null) {↵ | 5 | if (generator != null) {↵ | |
6 | tip = toolTipGenerator.generateToolTip(dataset, ↵ | 6 | tip = generator.generateToolTip(dataset, ↵ | |
7 | key);↵ | |||
8 | ↵ | 7 | series, item);↵ | |
9 | }↵ | 8 | }↵ | |
10 | String url = null;↵ | 9 | String url = null;↵ | |
11 | PieURLGenerator urlGenerator = getURLGenerator();↵ | 10 | ↵ | |
12 | if (urlGenerator != null) {↵ | 11 | if (getURLGenerator() != null) {↵ | |
13 | url = urlGenerator.generateURL(dataset, key, ↵ | 12 | url = getURLGenerator().generateURL(dataset, ↵ | |
14 | getPieIndex());↵ | |||
15 | ↵ | 13 | series, item);↵ | |
16 | }↵ | 14 | }↵ | |
17 | PieSectionEntity entity = new PieSectionEntity(path, ↵ | 15 | XYItemEntity entity = new XYItemEntity(entityArea, dataset,↵ | |
18 | dataset, getPieIndex(), section, key, tip, ↵ | 16 | ↵ | |
19 | url);↵ | |||
20 | ↵ | 17 | series, item, tip, url);↵ | |
21 | entities.add(entity);↵ | 18 | entities.add(entity);↵ | |
22 | } | 19 |
| |
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 |
Number of node comparisons | 49 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 4 |
Time elapsed for statement mapping (ms) | 71.5 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
57 | if (entities != null) | 66 | if (entities != null) | ||||||||||||||||||||||||
58 | String tip = null; | 67 | String tip = null; | ||||||||||||||||||||||||
59 | PieToolTipGenerator toolTipGenerator = getToolTipGenerator(); | | |||||||||||||||||||||||||
| 68 | XYToolTipGenerator generator = getToolTipGenerator(series, item); | |||||||||||||||||||||||||
60 | if (toolTipGenerator != null) |
| 69 | if (generator != null) | |||||||||||||||||||||||
61 | tip = toolTipGenerator.generateToolTip(dataset, key); |
| | ||||||||||||||||||||||||
|
| 70 | tip = generator.generateToolTip(dataset, series, item); | ||||||||||||||||||||||||
62 | String url = null; | 71 | String url = null; | ||||||||||||||||||||||||
63 | PieURLGenerator urlGenerator = getURLGenerator(); | | |||||||||||||||||||||||||
64 | if (urlGenerator != null) | | |||||||||||||||||||||||||
65 | url = urlGenerator.generateURL(dataset, key, getPieIndex()); |
| | ||||||||||||||||||||||||
| 72 | if (getURLGenerator() != null) | |||||||||||||||||||||||||
|
| 73 | url = getURLGenerator().generateURL(dataset, series, item); | ||||||||||||||||||||||||
66 | PieSectionEntity entity = new PieSectionEntity(path, dataset, getPieIndex(), section, key, tip, url); |
| 74 | XYItemEntity entity = new XYItemEntity(entityArea, dataset, series, item, tip, url); | |||||||||||||||||||||||
67 | entities.add(entity); |
| 75 | entities.add(entity); |
Row | Violation |
---|---|
1 | Type org.jfree.chart.labels.PieToolTipGenerator of variable toolTipGenerator does not match with type org.jfree.chart.labels.XYToolTipGenerator of variable generator |
2 | Unmatched statement tip=toolTipGenerator.generateToolTip(dataset,key); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement tip=generator.generateToolTip(dataset,series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement tip=generator.generateToolTip(dataset,series,item); cannot be moved before or after the extracted code, because it throws exception(s) that should be caught by a try block that will be extracted |
5 | Unmatched statement url=urlGenerator.generateURL(dataset,key,getPieIndex()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Unmatched statement url=getURLGenerator().generateURL(dataset,series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
7 | Expression new PieSectionEntity(path,dataset,getPieIndex(),section,key,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression new XYItemEntity(entityArea,dataset,series,item,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression new PieSectionEntity(path,dataset,getPieIndex(),section,key,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression new XYItemEntity(entityArea,dataset,series,item,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Clone fragment #1 returns variables tip, url , while Clone fragment #2 returns variables tip, url |
12 | The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.RingPlot and org.jfree.chart.renderer.xy.HighLowRenderer do not have a common superclass |