if (dataset != null) {
Integer m = (Integer) this.datasetToDomainAxisMap.get(
datasetIndex);
if (m == null) { // a dataset with no mapping is assigned to
// axis 0
if (axisIndex == 0) {
result.add(dataset);
}
}
else {
if (m.intValue() == axisIndex) {
result.add(dataset);
}
}
}
if (dataset != null) {
Integer m = (Integer) this.datasetToRangeAxisMap.get(i);
if (m == null) { // a dataset with no mapping is assigned to
// axis 0
if (index == 0) {
result.add(dataset);
}
}
else {
if (m.intValue() == index) {
result.add(dataset);
}
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java
|
Method name: List datasetsMappedToDomainAxis(int)
|
|
Method name: List datasetsMappedToRangeAxis(int)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (dataset != null) {↵ | | 1 | if (dataset != null) {↵
|
2 | Integer m = (Integer) this.datasetToDomainAxisMap.get(↵ | | 2 | Integer m = (Integer) this.datasetToRangeAxisMap.get(↵
|
3 | datasetIndex);↵ | | 3 | i);↵
|
4 | if (m == null) { // a dataset with no mapping is assigned to↵ | | 4 | if (m == null) { // a dataset with no mapping is assigned to↵
|
5 | // axis 0↵ | | 5 | // axis 0↵
|
6 | if (axisIndex == 0) {↵ | | 6 | if (index == 0) {↵
|
7 | result.add(dataset);↵ | | 7 | result.add(dataset);↵
|
8 | }↵ | | 8 | }↵
|
9 | }↵ | | 9 | }↵
|
10 | else {↵ | | 10 | else {↵
|
11 | if (m.intValue() == axisIndex) {↵ | | 11 | if (m.intValue() == index) {↵
|
12 | result.add(dataset);↵ | | 12 | result.add(dataset);↵
|
13 | }↵ | | 13 | }↵
|
14 | }↵ | | 14 | }↵
|
15 | } | | 15 | }
|
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) | 1.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 19 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 19.4 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
4 | if (dataset != null) | | 4 | if (dataset != null) |
5 | Integer m = (Integer)this.datasetToDomainAxisMap.get(datasetIndex); | | 5 | Integer m = (Integer)this.datasetToRangeAxisMap.get(i); |
6 | | | 6 | |
7 | | | 7 | |
8 | | | 8 | |
| | | | |
9 | if (m.intValue() == axisIndex) | | 9 | if (m.intValue() == index) |
10 | | | 10 | |
Precondition Violations (0)
Row |
Violation |