File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PiePlot3D.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYAreaRenderer2.java | |||
Method name: void draw(Graphics2D, Rectangle2D, Point2D, PlotState, PlotRenderingInfo)
|
Method name: void drawItem(Graphics2D, XYItemRendererState, Rectangle2D, PlotRenderingInfo, XYPlot, ValueAxis, ValueAxis, XYDataset, int, int, CrosshairState, int)
|
|||
Number of AST nodes: 12 | Number of AST nodes: 11 | |||
1 | if (info != null) {↵ | |||
2 | EntityCollection entities ↵ | |||
3 | = info.getOwner().getEntityCollection();↵ | 1 | EntityCollection entities = state.getEntityCollection();↵ | |
4 | if (entities != null) {↵ | 2 | if (entities != null && hotspot != null) {↵ | |
5 | String tip = null;↵ | 3 | String tip = null;↵ | |
6 | PieToolTipGenerator tipster = getToolTipGenerator();↵ | 4 | XYToolTipGenerator generator = getToolTipGenerator(↵ | |
7 | if (tipster != null) {↵ | 5 | ↵ | |
8 | // @mgs: using the method's return value was missing ↵ | |||
9 | ↵ | 6 | series, item↵ | |
7 | );↵ | |||
8 | if (generator != null) {↵ | |||
10 | tip = tipster.generateToolTip(dataset, currentKey);↵ | 9 | tip = generator.generateToolTip(dataset, series, item);↵ | |
11 | }↵ | 10 | }↵ | |
12 | String url = null;↵ | 11 | String url = null;↵ | |
13 | if (getURLGenerator() != null) {↵ | 12 | if (getURLGenerator() != null) {↵ | |
14 | url = getURLGenerator().generateURL(dataset, currentKey,↵ | 13 | url = getURLGenerator().generateURL(dataset, ↵ | |
15 | getPieIndex());↵ | |||
16 | ↵ | 14 | series, item);↵ | |
17 | }↵ | 15 | }↵ | |
18 | PieSectionEntity entity = new PieSectionEntity(↵ | 16 | XYItemEntity entity = new ↵ | |
19 | upperArc, dataset, getPieIndex(), sectionIndex, ↵ | 17 | XYItemEntity(hotspot, dataset, ↵ | |
20 | currentKey, tip, url);↵ | 18 | series, item, tip, url);↵ | |
21 | entities.add(entity);↵ | 19 | entities.add(entity);↵ | |
22 | }↵ | |||
23 | } | 20 |
| |
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.7 |
Clones location | Clones are in different classes |
Number of node comparisons | 48 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 5 |
Number of unmapped statements in the second code fragment | 5 |
Time elapsed for statement mapping (ms) | 131.1 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 58 | EntityCollection entities = state.getEntityCollection(); | |||||||||||||||||||||||||
197 | EntityCollection entities = info.getOwner().getEntityCollection(); |
| | ||||||||||||||||||||||||
198 | if (entities != null) |
| 59 | if (entities != null && hotspot != null) | |||||||||||||||||||||||
199 | String tip = null; | 60 | String tip = null; | ||||||||||||||||||||||||
| 61 | XYToolTipGenerator generator = getToolTipGenerator(series, item); | |||||||||||||||||||||||||
200 | PieToolTipGenerator tipster = getToolTipGenerator(); |
| | ||||||||||||||||||||||||
201 | if (tipster != null) |
| 62 | if (generator != null) | |||||||||||||||||||||||
|
| 63 | tip = generator.generateToolTip(dataset, series, item); | ||||||||||||||||||||||||
202 | tip = tipster.generateToolTip(dataset, currentKey); |
| | ||||||||||||||||||||||||
203 | String url = null; | 64 | String url = null; | ||||||||||||||||||||||||
204 | if (getURLGenerator() != null) |
| 65 | if (getURLGenerator() != null) | |||||||||||||||||||||||
|
| 66 | url = getURLGenerator().generateURL(dataset, series, item); | ||||||||||||||||||||||||
205 | url = getURLGenerator().generateURL(dataset, currentKey, getPieIndex()); |
| | ||||||||||||||||||||||||
206 | PieSectionEntity entity = new PieSectionEntity(upperArc, dataset, getPieIndex(), sectionIndex, currentKey, tip, url); |
| 67 | XYItemEntity entity = new XYItemEntity(hotspot, dataset, series, item, tip, url); | |||||||||||||||||||||||
|
| 68 | entities.add(entity); | ||||||||||||||||||||||||
207 | entities.add(entity); |
| |
Row | Violation |
---|---|
1 | Unmatched statement EntityCollection entities=info.getOwner().getEntityCollection(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression entities != null cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression entities != null && hotspot != null cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement PieToolTipGenerator tipster=getToolTipGenerator(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Type org.jfree.chart.labels.PieToolTipGenerator of variable tipster does not match with type org.jfree.chart.labels.XYToolTipGenerator of variable generator |
6 | 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 |
7 | 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 |
8 | Unmatched statement tip=tipster.generateToolTip(dataset,currentKey); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Type org.jfree.chart.urls.PieURLGenerator of variable getURLGenerator() does not match with type org.jfree.chart.urls.XYURLGenerator of variable getURLGenerator() |
10 | 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 |
11 | Unmatched statement url=getURLGenerator().generateURL(dataset,currentKey,getPieIndex()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
12 | Expression new PieSectionEntity(upperArc,dataset,getPieIndex(),sectionIndex,currentKey,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression new XYItemEntity(hotspot,dataset,series,item,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression new PieSectionEntity(upperArc,dataset,getPieIndex(),sectionIndex,currentKey,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression new XYItemEntity(hotspot,dataset,series,item,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Unmatched statement entities.add(entity); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
17 | Unmatched statement entities.add(entity); 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 |
18 | Unmatched statement entities.add(entity); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
19 | Unmatched statement entities.add(entity); 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 |
20 | Clone fragment #1 returns variables tip, url, entities, entity , while Clone fragment #2 returns variables tip, url, entities, entity |
21 | The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.PiePlot3D and org.jfree.chart.renderer.xy.XYAreaRenderer2 do not have a common superclass |