while (iterator.hasNext()) {
ValueTick tick = (ValueTick) iterator.next();
double current = tick.getValue();
if (fillBand) {
getRenderer().fillRangeGridBand(g2, this, axis, dataArea,
previous, current);
}
previous = current;
fillBand = !fillBand;
}
for (int item = 0; item < itemCount; item++) {
double value = dataset.getYValue(series, item);
if (!Double.isNaN(value)) {
minimum = Math.min(minimum, value);
maximum = Math.max(maximum, value);
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java
|
Method name: void drawRangeTickBands(Graphics2D, Rectangle2D, List)
|
|
Method name: Range iterateRangeBounds(XYDataset, boolean)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 5
|
|
1 | while (iterator.hasNext()) {↵ | | |
|
2 | ValueTick tick = (ValueTick) iterator.next();↵ | | |
|
| | | 1 | for (int item = 0; item < itemCount; item++) {↵
|
3 | double current = tick.getValue();↵ | | 2 | double value = dataset.getYValue(↵
|
4 | if (fillBand) {↵ | | |
|
5 | getRenderer().fillRangeGridBand(g2, this, axis, dataArea,↵ | | |
|
6 | previous, current↵ | | 3 | series, item);↵
|
| | | 4 | if (!Double.isNaN(value)) {↵
|
| | | 5 | minimum = Math.min(minimum, value);↵
|
7 | );↵ | | 6 | maximum = Math.max(maximum, value);↵
|
8 | }↵ | | 7 | ↵
|
9 | ↵ | | 8 | }↵
|
10 | previous = current;↵ | | 9 | ↵
|
11 | fillBand = !fillBand;↵ | | |
|
12 | } | | 10 | }
|
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.1 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 1.2 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | ValueTick tick = (ValueTick)iterator.next(); | | | |
9 | double current = tick.getValue(); | | | |
| | | 29 | double value = dataset.getYValue(series, item); |
10 | if (fillBand) | | 30 | if (!Double.isNaN(value)) |
11 | getRenderer().fillRangeGridBand(g2, this, axis, dataArea, previous, current); | | | |
| | | 31 | minimum = Math.min(minimum, value); |
| | | 32 | maximum = Math.max(maximum, value); |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched statement double value=dataset.getYValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |