for (int item = 0; item < itemCount; item++) {
lvalue = dataset.getXValue(series, item);
uvalue = lvalue;
minimum = Math.min(minimum, lvalue);
maximum = Math.max(maximum, uvalue);
}
for (int item = 0; item < itemCount; item++) {
lvalue = dataset.getXValue(series, item);
uvalue = lvalue;
minimum = Math.min(minimum, lvalue);
maximum = Math.max(maximum, uvalue);
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/VectorRenderer.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java
|
Method name: Range findDomainBounds(XYDataset)
|
|
Method name: Range iterateDomainBounds(XYDataset, boolean)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | for (int item = 0; item < itemCount; item++) {↵ | | 1 | for (int item = 0; item < itemCount; item++) {↵
|
2 | lvalue = dataset.getXValue(series, item);↵ | | 2 | lvalue = dataset.getXValue(series, item);↵
|
3 | uvalue = lvalue;↵ | | 3 | uvalue = lvalue;↵
|
4 | minimum = Math.min(minimum, lvalue);↵ | | 4 | minimum = Math.min(minimum, lvalue);↵
|
5 | maximum = Math.max(maximum, uvalue);↵ | | 5 | maximum = Math.max(maximum, uvalue);↵
|
6 | } | | 6 | }
|
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.2 |
Clones location | Clones are in different classes |
Number of node comparisons | 28 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 9.4 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
23 | for (int item = 0; item < itemCount; item++) | | 19 | for (int item = 0; item < itemCount; item++) |
24 | lvalue = dataset.getXValue(series, item); | | 20 | lvalue = dataset.getXValue(series, item); |
25 | | | 21 | |
26 | minimum = Math.min(minimum, lvalue); | | 22 | minimum = Math.min(minimum, lvalue); |
27 | maximum = Math.max(maximum, uvalue); | | 23 | maximum = Math.max(maximum, uvalue); |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables minimum, maximum , while Clone fragment #2 returns variables minimum, maximum |