if (entities != null) {
String tip = "";
if (getToolTipGenerator() != null) {
tip = this.toolTipGenerator.generateToolTip(data, k);
}
// Shape s = g2.getClip();
// if (s.contains(rect) || s.intersects(rect)) {
String url = null;
// if (getURLGenerator() != null) { //dmo: look at this later
// url = getURLGenerator().generateURL(data, series, item);
// }
// Unlike XYItemRenderer, we need to clone entityArea since it
// reused.
ContourEntity entity = new ContourEntity(
(Rectangle2D.Double) entityArea.clone(), tip, url);
entity.setIndex(k);
entities.add(entity);
// }
}
if (entities != null) {
String tip = null;
if (getToolTipGenerator() != null) {
tip = this.toolTipGenerator.generateToolTip(data, k);
}
String url = null;
// if (getURLGenerator() != null) { //dmo: look at this later
// url = getURLGenerator().generateURL(data, series, item);
// }
// Unlike XYItemRenderer, we need to clone entityArea since it
// reused.
ContourEntity entity = new ContourEntity(
(RectangularShape) entityArea.clone(), tip, url);
entity.setIndex(k);
entities.add(entity);
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/ContourPlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/ContourPlot.java
|
Method name: void contourRenderer(Graphics2D, Rectangle2D, PlotRenderingInfo, ContourPlot, ValueAxis, ValueAxis, ColorBar, ContourDataset, CrosshairState)
|
|
Method name: void pointRenderer(Graphics2D, Rectangle2D, PlotRenderingInfo, ContourPlot, ValueAxis, ValueAxis, ColorBar, ContourDataset, CrosshairState)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if (entities != null) {↵ | | 1 | if (entities != null) {↵
|
2 | String tip = "";↵ | | 2 | String tip = null;↵
|
3 | if (getToolTipGenerator() != null) {↵ | | 3 | if (getToolTipGenerator() != null) {↵
|
4 | tip = this.toolTipGenerator.generateToolTip(data, k);↵ | | 4 | tip = this.toolTipGenerator.generateToolTip(data, k);↵
|
5 | }↵ | | 5 | }↵
|
6 | // Shape s = g2.getClip();↵ | | |
|
7 | // if (s.contains(rect) || s.intersects(rect)) {↵ | | |
|
8 | String url = null;↵ | | 6 | String url = null;↵
|
9 | // if (getURLGenerator() != null) { //dmo: look at this later↵ | | 7 | // if (getURLGenerator() != null) { //dmo: look at this later↵
|
10 | // url = getURLGenerator().generateURL(data, series, item);↵ | | 8 | // url = getURLGenerator().generateURL(data, series, item);↵
|
11 | // }↵ | | 9 | // }↵
|
12 | // Unlike XYItemRenderer, we need to clone entityArea since it ↵ | | 10 | // Unlike XYItemRenderer, we need to clone entityArea since it ↵
|
13 | // reused.↵ | | 11 | // reused.↵
|
14 | ContourEntity entity = new ContourEntity(↵ | | 12 | ContourEntity entity = new ContourEntity(↵
|
15 | (Rectangle2D.Double) entityArea.clone(), tip, url);↵ | | 13 | (RectangularShape) entityArea.clone(), tip, url);↵
|
16 | entity.setIndex(k);↵ | | 14 | entity.setIndex(k);↵
|
17 | entities.add(entity);↵ | | 15 | entities.add(entity);↵
|
18 | // }↵ | | |
|
19 | } | | 16 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 41 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 8 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 16.5 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
88 | if (entities != null) | | 34 | if (entities != null) |
89 | | | 38 | |
90 | if (getToolTipGenerator() != null) | | 36 | if (getToolTipGenerator() != null) |
91 | tip = this.toolTipGenerator.generateToolTip(data, k); | | 37 | tip = this.toolTipGenerator.generateToolTip(data, k); |
92 | | | 35 | |
93 | ContourEntity entity = new ContourEntity((Rectangle2D.Double)entityArea.clone(), tip, url); | | 39 | ContourEntity entity = new ContourEntity((RectangularShape)entityArea.clone(), tip, url); |
94 | | | 40 | |
95 | | | 41 | |
Precondition Violations (4)
Row |
Violation |
1 | Expression tip cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression url cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression url cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression tip cannot be parameterized, because it has dependencies to/from statements that will be extracted |