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/XYAreaRenderer2.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: 13 | Number of AST nodes: 11 | |||
1 | if (state.getInfo() != null) {↵ | |||
2 | EntityCollection entities = state.getEntityCollection();↵ | 1 | EntityCollection entities = state.getEntityCollection();↵ | |
3 | if (entities != null) {↵ | 2 | if (entities != null↵ | |
4 | ↵ | 3 | && hotspot != null) {↵ | |
5 | String tip = null;↵ | 4 | String tip = null;↵ | |
6 | PieToolTipGenerator toolTipGenerator ↵ | 5 | XYToolTipGenerator generator = getToolTipGenerator(↵ | |
7 | = getToolTipGenerator();↵ | 6 | ↵ | |
8 | ↵ | 7 | series, item↵ | |
8 | );↵ | |||
9 | if (toolTipGenerator != null) {↵ | 9 | if (generator != null) {↵ | |
10 | tip = toolTipGenerator.generateToolTip(dataset, ↵ | 10 | tip = generator.generateToolTip(dataset, ↵ | |
11 | key);↵ | 11 | series, item);↵ | |
12 | }↵ | 12 | ↵ | |
13 | ↵ | 13 | }↵ | |
14 | String url = null;↵ | 14 | String url = null;↵ | |
15 | PieURLGenerator urlGenerator = getURLGenerator();↵ | 15 | ↵ | |
16 | if (urlGenerator != null) {↵ | 16 | if (getURLGenerator() != null) {↵ | |
17 | url = urlGenerator.generateURL(dataset, key, ↵ | 17 | url = getURLGenerator().generateURL(dataset, ↵ | |
18 | getPieIndex());↵ | |||
19 | ↵ | 18 | series, item);↵ | |
20 | }↵ | 19 | }↵ | |
21 | PieSectionEntity entity = new PieSectionEntity(path, ↵ | 20 | XYItemEntity entity = new XYItemEntity(hotspot, dataset, ↵ | |
22 | dataset, getPieIndex(), section, key, tip, ↵ | 21 | ↵ | |
23 | url);↵ | |||
24 | ↵ | 22 | series, item, tip, url);↵ | |
25 | entities.add(entity);↵ | 23 | entities.add(entity);↵ | |
26 | }↵ | |||
27 | } | 24 |
| |
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.5 |
Clones location | Clones are in different classes |
Number of node comparisons | 51 |
Number of mapped statements | 7 |
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) | 73.1 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
56 | EntityCollection entities = state.getEntityCollection(); |
| 58 | EntityCollection entities = state.getEntityCollection(); | |||||||||||||||||||||||
57 | if (entities != null) |
| 59 | if (entities != null && hotspot != null) | |||||||||||||||||||||||
58 | String tip = null; | 60 | String tip = null; | ||||||||||||||||||||||||
59 | PieToolTipGenerator toolTipGenerator = getToolTipGenerator(); | | |||||||||||||||||||||||||
| 61 | XYToolTipGenerator generator = getToolTipGenerator(series, item); | |||||||||||||||||||||||||
60 | if (toolTipGenerator != null) |
| 62 | if (generator != null) | |||||||||||||||||||||||
61 | tip = toolTipGenerator.generateToolTip(dataset, key); |
| | ||||||||||||||||||||||||
|
| 63 | tip = generator.generateToolTip(dataset, series, item); | ||||||||||||||||||||||||
62 | String url = null; | 64 | String url = null; | ||||||||||||||||||||||||
63 | PieURLGenerator urlGenerator = getURLGenerator(); | | |||||||||||||||||||||||||
64 | if (urlGenerator != null) | | |||||||||||||||||||||||||
65 | url = urlGenerator.generateURL(dataset, key, getPieIndex()); |
| | ||||||||||||||||||||||||
| 65 | if (getURLGenerator() != null) | |||||||||||||||||||||||||
|
| 66 | url = getURLGenerator().generateURL(dataset, series, item); | ||||||||||||||||||||||||
66 | PieSectionEntity entity = new PieSectionEntity(path, dataset, getPieIndex(), section, key, tip, url); |
| 67 | XYItemEntity entity = new XYItemEntity(hotspot, dataset, series, item, tip, url); | |||||||||||||||||||||||
67 | entities.add(entity); |
| 68 | entities.add(entity); |
Row | Violation |
---|---|
1 | Expression entities != null cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression entities != null && hotspot != null cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Type org.jfree.chart.labels.PieToolTipGenerator of variable toolTipGenerator does not match with type org.jfree.chart.labels.XYToolTipGenerator of variable generator |
4 | 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 |
5 | 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 |
6 | 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 |
7 | 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 |
8 | 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 |
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(hotspot,dataset,series,item,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression new PieSectionEntity(path,dataset,getPieIndex(),section,key,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression new XYItemEntity(hotspot,dataset,series,item,tip,url) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Clone fragment #1 returns variables tip, url , while Clone fragment #2 returns variables tip, url |
14 | The refactoring of the clones is infeasible, because classes org.jfree.chart.plot.RingPlot and org.jfree.chart.renderer.xy.XYAreaRenderer2 do not have a common superclass |