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 hashCode()
|
Method name: int hashCode()
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | int result = super.hashCode();↵ | 1 | int result = super.hashCode();↵ | |
2 | // it is too slow to look at every data item, so let's just look at↵ | 2 | // it is too slow to look at every data item, so let's just look at↵ | |
3 | // the first, middle and last items...↵ | 3 | // the first, middle and last items...↵ | |
4 | int count = getItemCount();↵ | 4 | int count = getItemCount();↵ | |
5 | if (count > 0) {↵ | 5 | if (count > 0) {↵ | |
6 | ComparableObjectItem item = getDataItem(0);↵ | 6 | XYDataItem item = getDataItem(0);↵ | |
7 | result = 29 * result + item.hashCode();↵ | 7 | result = 29 * result + item.hashCode();↵ | |
8 | }↵ | 8 | }↵ | |
9 | if (count > 1) {↵ | 9 | if (count > 1) {↵ | |
10 | ComparableObjectItem item = getDataItem(count - 1);↵ | 10 | XYDataItem item = getDataItem(count - 1);↵ | |
11 | result = 29 * result + item.hashCode();↵ | 11 | result = 29 * result + item.hashCode();↵ | |
12 | }↵ | 12 | }↵ | |
13 | if (count > 2) {↵ | 13 | if (count > 2) {↵ | |
14 | ComparableObjectItem item = getDataItem(count / 2);↵ | 14 | XYDataItem item = getDataItem(count / 2);↵ | |
15 | result = 29 * result + item.hashCode();↵ | 15 | result = 29 * result + item.hashCode();↵ | |
16 | }↵ | 16 | }↵ | |
17 | result = 29 * result + this.maximumItemCount;↵ | 17 | result = 29 * result + this.maximumItemCount;↵ | |
18 | result = 29 * result + (this.autoSort ? 1 : 0);↵ | 18 | result = 29 * result + (this.autoSort ? 1 : 0);↵ | |
19 | result = 29 * result + (this.allowDuplicateXValues ? 1 : 0);↵ | 19 | result = 29 * result + (this.allowDuplicateXValues ? 1 : 0);↵ | |
20 | return result; | 20 |
| |
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.3 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 93 |
Number of mapped statements | 12 |
Number of unmapped statements in the first code fragment | 3 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 7.2 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | int result = super.hashCode(); |
| 1 | int result = super.hashCode(); | |||||||||||
2 | int count = getItemCount(); | 2 | int count = getItemCount(); | ||||||||||||
3 | if (count > 0) | 3 | if (count > 0) | ||||||||||||
| 4 | XYDataItem item = getDataItem(0); | |||||||||||||
4 | ComparableObjectItem item = getDataItem(0); | | |||||||||||||
5 | result = 29 * result + item.hashCode(); |
| 5 | result = 29 * result + item.hashCode(); | |||||||||||
6 | if (count > 1) | 6 | if (count > 1) | ||||||||||||
|
| 7 | XYDataItem item = getDataItem(count - 1); | ||||||||||||
7 | ComparableObjectItem item = getDataItem(count - 1); |
| | ||||||||||||
8 | result = 29 * result + item.hashCode(); |
| 8 | result = 29 * result + item.hashCode(); | |||||||||||
9 | if (count > 2) | 9 | if (count > 2) | ||||||||||||
|
| 10 | XYDataItem item = getDataItem(count / 2); | ||||||||||||
10 | ComparableObjectItem item = getDataItem(count / 2); |
| | ||||||||||||
11 | result = 29 * result + item.hashCode(); |
| 11 | result = 29 * result + item.hashCode(); | |||||||||||
12 | result = 29 * result + this.maximumItemCount; | 12 | result = 29 * result + this.maximumItemCount; | ||||||||||||
13 | result = 29 * result + (this.autoSort ? 1 : 0); | 13 | result = 29 * result + (this.autoSort ? 1 : 0); | ||||||||||||
14 | result = 29 * result + (this.allowDuplicateXValues ? 1 : 0); | 14 | result = 29 * result + (this.allowDuplicateXValues ? 1 : 0); | ||||||||||||
15 | return result; | 15 | return result; |
Row | Violation |
---|---|
1 | Super method call int result=super.hashCode(); cannot be extracted from method |
2 | Super method call int result=super.hashCode(); cannot be extracted from method |
3 | Type org.jfree.data.ComparableObjectItem of variable item does not match with type org.jfree.data.xy.XYDataItem of variable item |
4 | Unmatched statement XYDataItem item=getDataItem(count - 1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
5 | Unmatched statement ComparableObjectItem item=getDataItem(count - 1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
6 | Type org.jfree.data.ComparableObjectItem of variable item does not match with type org.jfree.data.xy.XYDataItem of variable item |
7 | Unmatched statement XYDataItem item=getDataItem(count / 2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
8 | Unmatched statement ComparableObjectItem item=getDataItem(count / 2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
9 | Type org.jfree.data.ComparableObjectItem of variable item does not match with type org.jfree.data.xy.XYDataItem of variable item |