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(data, row, column);
}
String url = null;
if (getItemURLGenerator(row, column) != null) {
url = getItemURLGenerator(row, column).generateURL(data,
row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(bar, tip,
url, data, data.getRowKey(row),
data.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(data, row, column);
}
String url = null;
if (getItemURLGenerator(row, column) != null) {
url = getItemURLGenerator(row, column).generateURL(
data, row, column);
}
CategoryItemEntity entity = new CategoryItemEntity(bar, tip,
url, data, data.getRowKey(row),
data.getColumnKey(column));
entities.add(entity);
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LayeredBarRenderer.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/category/LayeredBarRenderer.java
|
Method name: void drawHorizontalItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int)
|
|
Method name: void drawVerticalItem(Graphics2D, CategoryItemRendererState, Rectangle2D, CategoryPlot, CategoryAxis, ValueAxis, CategoryDataset, int, int)
|
Number of AST nodes: 12
|
|
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 | CategoryToolTipGenerator tipster↵ | | 5 | CategoryToolTipGenerator tipster↵
|
6 | = getToolTipGenerator(row, column);↵ | | 6 | = getToolTipGenerator(row, column);↵
|
7 | if (tipster != null) {↵ | | 7 | if (tipster != null) {↵
|
8 | tip = tipster.generateToolTip(data, row, column);↵ | | 8 | tip = tipster.generateToolTip(data, row, column);↵
|
9 | }↵ | | 9 | }↵
|
10 | String url = null;↵ | | 10 | String url = null;↵
|
11 | if (getItemURLGenerator(row, column) != null) {↵ | | 11 | if (getItemURLGenerator(row, column) != null) {↵
|
12 | url = getItemURLGenerator(row, column).generateURL(data,↵ | | 12 | url = getItemURLGenerator(row, column).generateURL(↵
|
13 | row, column);↵ | | 13 | data, row, column);↵
|
14 | }↵ | | 14 | }↵
|
15 | CategoryItemEntity entity = new CategoryItemEntity(bar, tip,↵ | | 15 | CategoryItemEntity entity = new CategoryItemEntity(bar, tip,↵
|
16 | url, data, data.getRowKey(row),↵ | | 16 | url, data, data.getRowKey(row),↵
|
17 | data.getColumnKey(column));↵ | | 17 | data.getColumnKey(column));↵
|
18 | entities.add(entity);↵ | | 18 | entities.add(entity);↵
|
19 | }↵ | | 19 | }↵
|
20 | } | | 20 | }
|
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 50 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 12 |
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) | 38.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
58 | if (state.getInfo() != null) | | 61 | if (state.getInfo() != null) |
59 | EntityCollection entities = state.getEntityCollection(); | | 62 | EntityCollection entities = state.getEntityCollection(); |
60 | | | 63 | |
61 | | | 64 | |
62 | CategoryToolTipGenerator tipster = getToolTipGenerator(row, column); | | 65 | CategoryToolTipGenerator tipster = getToolTipGenerator(row, column); |
63 | | | 66 | |
64 | tip = tipster.generateToolTip(data, row, column); | | 67 | tip = tipster.generateToolTip(data, row, column); |
65 | | | 68 | |
66 | if (getItemURLGenerator(row, column) != null) | | 69 | if (getItemURLGenerator(row, column) != null) |
67 | url = getItemURLGenerator(row, column).generateURL(data, row, column); | | 70 | url = getItemURLGenerator(row, column).generateURL(data, row, column); |
68 | CategoryItemEntity entity = new CategoryItemEntity(bar, tip, url, data, data.getRowKey(row), data.getColumnKey(column)); | | 71 | CategoryItemEntity entity = new CategoryItemEntity(bar, tip, url, data, data.getRowKey(row), data.getColumnKey(column)); |
69 | | | 72 | |
Precondition Violations (0)
Row |
Violation |