String tip = null;
PieToolTipGenerator toolTipGenerator
= getToolTipGenerator();
if (toolTipGenerator != null) {
tip = toolTipGenerator.generateToolTip(dataset,
key);
}
String url = null;
PieURLGenerator urlGenerator = getURLGenerator();
if (urlGenerator != null) {
url = urlGenerator.generateURL(dataset, key,
getPieIndex());
}
PieSectionEntity entity = new PieSectionEntity(path,
dataset, getPieIndex(), section, key, tip,
url);
entities.add(entity);
String tip = null;
XYToolTipGenerator generator
= getToolTipGenerator(series, item);
if (generator != null) {
tip = generator.generateToolTip(dataset, series, item);
}
String url = null;
if (getURLGenerator() != null) {
url = getURLGenerator().generateURL(dataset, series,
item);
}
XYItemEntity entity = new XYItemEntity(shape, dataset,
series, item, tip, url);
entities.add(entity);
Clone fragments detected by clone detection tool
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/StackedXYAreaRenderer.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: 10
|
|
Number of AST nodes: 9
|
|
1 | String tip = null;↵ | | 1 | String tip = null;↵
|
2 | PieToolTipGenerator toolTipGenerator ↵ | | 2 | XYToolTipGenerator generator↵
|
3 | = getToolTipGenerator();↵ | | 3 | = getToolTipGenerator(series, item);↵
|
4 | if (toolTipGenerator != null) {↵ | | 4 | if (generator != null) {↵
|
5 | tip = toolTipGenerator.generateToolTip(dataset, ↵ | | 5 | tip = generator.generateToolTip(dataset, ↵
|
6 | key);↵ | | 6 | series, item);↵
|
7 | }↵ | | 7 | ↵
|
8 | ↵ | | 8 | }↵
|
9 | String url = null;↵ | | 9 | String url = null;↵
|
10 | PieURLGenerator urlGenerator = getURLGenerator();↵ | | 10 | ↵
|
11 | if (urlGenerator != null) {↵ | | 11 | if (getURLGenerator() != null) {↵
|
12 | url = urlGenerator.generateURL(dataset, key, ↵ | | 12 | url = getURLGenerator().generateURL(dataset, series,↵
|
13 | getPieIndex());↵ | | 13 | ↵
|
14 | ↵ | | 14 | item);↵
|
15 | }↵ | | 15 | }↵
|
16 | PieSectionEntity entity = new PieSectionEntity(path, ↵ | | 16 | XYItemEntity entity = new XYItemEntity(shape, dataset,↵
|
17 | dataset, getPieIndex(), section, key, tip, ↵ | | 17 | ↵
|
18 | url);↵ | | 18 | series, item, tip, url);↵
|
19 | entities.add(entity); | | 19 | entities.add(entity);
|
See real code fragment |
|
See real code fragment |
Summary
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 | 12 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 3.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
58 | String tip = null; | | 88 | String tip = null; |
59 | PieToolTipGenerator toolTipGenerator = getToolTipGenerator(); | | | |
| | | 89 | XYToolTipGenerator generator = getToolTipGenerator(series, item); |
60 | if (toolTipGenerator != null) | | 90 | if (generator != null) |
61 | tip = toolTipGenerator.generateToolTip(dataset, key); | | | |
| | | 91 | tip = generator.generateToolTip(dataset, series, item); |
Precondition Violations (4)
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 |