if (state.getInfo() != null) {
EntityCollection entities = state.getEntityCollection();
if (entities != null) {
String tip = null;
if (getToolTipGenerator(row, column) != null) {
tip = getToolTipGenerator(row, column).generateToolTip(
dataset, row, column);
}
String url = null;
if (getItemURLGenerator(row, column) != null) {
url = getItemURLGenerator(row, column).generateURL(
dataset, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(
bar, tip, url, dataset, dataset.getRowKey(row),
dataset.getColumnKey(column));
entities.add(entity);
}
}
if (state.getInfo() != null) {
EntityCollection entities = state.getEntityCollection();
if (entities != null) {
String tip = null;
CategoryToolTipGenerator tipster = getToolTipGenerator(row,
column);
if (tipster != null) {
tip = tipster.generateToolTip(dataset, row, column);
}
String url = null;
if (getItemURLGenerator(row, column) != null) {
url = getItemURLGenerator(row, column).generateURL(
dataset, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(bar, tip,
url, dataset, dataset.getRowKey(row),
dataset.getColumnKey(column));
entities.add(entity);
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/GanttRenderer.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/GanttRenderer.java
|
Method name: void drawTasks(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, GanttCategoryDataset, int, int)
|
|
Method name: void drawTask(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, GanttCategoryDataset, int, int)
|
Number of AST nodes: 11
|
|
Number of AST nodes: 12
|
|
1 | if (state.getInfo() != null) {↵ | | 1 | if (state.getInfo() != null) {↵
|
2 | EntityCollection entities = state.getEntityCollection();↵ | | 2 | EntityCollection entities = state.getEntityCollection();↵
|
3 | if (entities != null) {↵ | | 3 | if (entities != null) {↵
|
4 | String tip = null;↵ | | 4 | String tip = null;↵
|
5 | if (getToolTipGenerator(row, column)↵ | | 5 | CategoryToolTipGenerator tipster = getToolTipGenerator(row,↵
|
| | | 6 | column);↵
|
6 | != null) {↵ | | 7 | if (tipster != null) {↵
|
7 | tip = getToolTipGenerator(row, column).generateToolTip(↵ | | 8 | tip = ↵
|
8 | dataset, row, column);↵ | | 9 | tipster.generateToolTip(dataset, row, column);↵
|
9 | }↵ | | 10 | ↵
|
10 | ↵ | | 11 | }↵
|
11 | String url = null;↵ | | 12 | String url = null;↵
|
12 | if (getItemURLGenerator(row, column) != null) {↵ | | 13 | if (getItemURLGenerator(row, column) != null) {↵
|
13 | url = getItemURLGenerator(row, column).generateURL(↵ | | 14 | url = getItemURLGenerator(row, column).generateURL(↵
|
14 | dataset, row, column);↵ | | 15 | dataset, row, column);↵
|
15 | }↵ | | 16 | }↵
|
16 | CategoryItemEntity entity = new CategoryItemEntity(↵ | | 17 | CategoryItemEntity entity = new CategoryItemEntity(bar, tip,↵
|
17 | bar, tip, url, dataset, dataset.getRowKey(row),↵ | | 18 | url, dataset, dataset.getRowKey(row),↵
|
18 | dataset.getColumnKey(column));↵ | | 19 | dataset.getColumnKey(column));↵
|
19 | entities.add(entity);↵ | | 20 | entities.add(entity);↵
|
20 | }↵ | | 21 | ↵
|
21 | ↵ | | 22 | }↵
|
22 | } | | 23 | }
|
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 | 47 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 11 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 2.7 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
52 | if (state.getInfo() != null) | | 58 | if (state.getInfo() != null) |
53 | EntityCollection entities = state.getEntityCollection(); | | 59 | EntityCollection entities = state.getEntityCollection(); |
54 | | | 60 | |
55 | | | 61 | |
| | | 62 | CategoryToolTipGenerator tipster = getToolTipGenerator(row, column); |
56 | if (getToolTipGenerator(row, column) != null) | | 63 | |
57 | tip = getToolTipGenerator(row, column).generateToolTip(dataset, row, column); | | 64 | tip = tipster.generateToolTip(dataset, row, column); |
58 | | | 65 | |
59 | if (getItemURLGenerator(row, column) != null) | | 66 | if (getItemURLGenerator(row, column) != null) |
60 | url = getItemURLGenerator(row, column).generateURL(dataset, row, column); | | 67 | url = getItemURLGenerator(row, column).generateURL(dataset, row, column); |
61 | CategoryItemEntity entity = new CategoryItemEntity(bar, tip, url, dataset, dataset.getRowKey(row), dataset.getColumnKey(column)); | | 68 | CategoryItemEntity entity = new CategoryItemEntity(bar, tip, url, dataset, dataset.getRowKey(row), dataset.getColumnKey(column)); |
62 | | | 69 | |
Precondition Violations (0)
Row |
Violation |