if (this.autoSort) {
return Collections.binarySearch(this.data, new ComparableObjectItem(
x, null));
}
else {
for (int i = 0; i < this.data.size(); i++) {
ComparableObjectItem item = (ComparableObjectItem)
this.data.get(i);
if (item.getComparable().equals(x)) {
return i;
}
}
return -1;
}
if (this.autoSort) {
return Collections.binarySearch(this.data, new XYDataItem(x, null));
}
else {
for (int i = 0; i < this.data.size(); i++) {
XYDataItem item = (XYDataItem) this.data.get(i);
if (item.getX().equals(x)) {
return i;
}
}
return -1;
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/ComparableObjectSeries.java
|
|
File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XYSeries.java
|
Method name:
|
|
Method name:
|
Number of AST nodes: 0
|
|
Number of AST nodes: 0
|
|
1 | if (this.autoSort) {↵ | | 1 | if (this.autoSort) {↵
|
2 | return Collections.binarySearch(this.data, new ComparableObjectItem(↵ | | 2 | return Collections.binarySearch(this.data, new ↵
|
3 | x, null)); ↵ | | 3 | XYDataItem(x, null));↵
|
4 | }↵ | | 4 | }↵
|
5 | else {↵ | | 5 | else {↵
|
6 | for (int i = 0; i < this.data.size(); i++) {↵ | | 6 | for (int i = 0; i < this.data.size(); i++) {↵
|
7 | ComparableObjectItem item = (ComparableObjectItem) ↵ | | 7 | ↵
|
8 | this.data.get(i);↵ | | 8 | XYDataItem item = (XYDataItem) this.data.get(i);↵
|
9 | if (item.getComparable().equals(x)) {↵ | | 9 | if (item.getX().equals(x)) {↵
|
10 | return i; ↵ | | 10 | return i;↵
|
11 | }↵ | | 11 | }↵
|
12 | }↵ | | 12 | }↵
|
13 | return -1;↵ | | 13 | return -1;↵
|
14 | } | | 14 | }
|
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.0 |
Clones location | |
Number of node comparisons | 0 |