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: int indexOf(Comparable)
|
Method name: int indexOf(Number)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
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 |
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.8 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 17 |
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 8.6 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (this.autoSort) | 1 | if (this.autoSort) | |||||||||||||||||||||||||
2 | return Collections.binarySearch(this.data, new ComparableObjectItem(x, null)); |
| 2 | return Collections.binarySearch(this.data, new XYDataItem(x, null)); | ||||||||||||||||||||||||
else | else | |||||||||||||||||||||||||||
3 | for (int i = 0; i < this.data.size(); i++) | 3 | for (int i = 0; i < this.data.size(); i++) | |||||||||||||||||||||||||
|
| 4 | XYDataItem item = (XYDataItem)this.data.get(i); | |||||||||||||||||||||||||
4 | ComparableObjectItem item = (ComparableObjectItem)this.data.get(i); |
| | |||||||||||||||||||||||||
5 | if (item.getComparable().equals(x)) |
| 5 | if (item.getX().equals(x)) | ||||||||||||||||||||||||
6 | return i; | 6 | return i; | |||||||||||||||||||||||||
7 | return -1; | 7 | return -1; |
Row | Violation |
---|---|
1 | Type org.jfree.data.ComparableObjectItem does not match with type org.jfree.data.xy.XYDataItem |
2 | Type java.lang.Comparable of variable x does not match with type java.lang.Number of variable x |
3 | Unmatched statement XYDataItem item=(XYDataItem)this.data.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Unmatched statement ComparableObjectItem item=(ComparableObjectItem)this.data.get(i); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Type java.lang.Comparable of variable x does not match with type java.lang.Number of variable x |
6 | Expression item.getComparable() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression item.getX() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Type java.lang.Comparable of variable item.getComparable() does not match with type java.lang.Number of variable item.getX() |
9 | Type org.jfree.data.ComparableObjectItem of variable item does not match with type org.jfree.data.xy.XYDataItem of variable item |
10 | Not all possible execution flows end in a return statement |