for (int i = 0; i < this.datasetInfo.size(); i++) {
SeriesDataset child = getDatasetInfo(i).data;
if (child instanceof CombinationDataset) {
SeriesDataset childParent
= ((CombinationDataset) child).getParent();
if (parent == null) {
parent = childParent;
}
else if (parent != childParent) {
return null;
}
}
else {
return null;
}
}
for (int i = 0; i < this.datasetInfo.size(); i++) {
SeriesDataset child = getDatasetInfo(i).data;
if (child instanceof CombinationDataset) {
int[] childMap = ((CombinationDataset) child).getMap();
if (childMap == null) {
return null;
}
map = joinMap(map, childMap);
}
else {
return null;
}
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/general/CombinedDataset.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/general/CombinedDataset.java
|
Method name: SeriesDataset getParent()
|
|
Method name: int[] getMap()
|
Number of AST nodes: 9
|
|
Number of AST nodes: 8
|
|
1 | for (int i = 0; i < this.datasetInfo.size(); i++) {↵ | | 1 | for (int i = 0; i < this.datasetInfo.size(); i++) {↵
|
2 | SeriesDataset child = getDatasetInfo(i).data;↵ | | 2 | SeriesDataset child = getDatasetInfo(i).data;↵
|
3 | if (child instanceof CombinationDataset) {↵ | | 3 | if (child instanceof CombinationDataset) {↵
|
4 | SeriesDataset childParent ↵ | | 4 | ↵
|
5 | = ((CombinationDataset) child).getParent();↵ | | 5 | int[] childMap = ((CombinationDataset) child).getMap();↵
|
6 | if (parent == null) {↵ | | 6 | if (childMap == null) {↵
|
7 | parent = childParent;↵ | | 7 | return null;↵
|
8 | }↵ | | 8 | }↵
|
9 | else if (parent != childParent) {↵ | | 9 | ↵
|
10 | return null;↵ | | |
|
11 | }↵ | | 10 | map = joinMap(map, childMap);↵
|
12 | }↵ | | 11 | }↵
|
13 | else {↵ | | 12 | else {↵
|
14 | return null;↵ | | 13 | return null;↵
|
15 | }↵ | | 14 | }↵
|
16 | } | | 15 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 0 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 2 |