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: void add(ComparableObjectItem, boolean)
|
Method name: void add(XYDataItem, boolean)
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | if (this.allowDuplicateXValues) {↵ | 1 | if (this.allowDuplicateXValues) {↵ | |
2 | // need to make sure we are adding *after* any duplicates↵ | 2 | // need to make sure we are adding *after* any duplicates↵ | |
3 | int size = this.data.size();↵ | 3 | int size = this.data.size();↵ | |
4 | while (index < size ↵ | 4 | while (index < size↵ | |
5 | && item.compareTo(this.data.get(index)) == 0) {↵ | 5 | && item.compareTo(this.data.get(index)) == 0) {↵ | |
6 | index++;↵ | 6 | index++;↵ | |
7 | }↵ | 7 | }↵ | |
8 | if (index < this.data.size()) {↵ | 8 | if (index < this.data.size()) {↵ | |
9 | this.data.add(index, item);↵ | 9 | this.data.add(index, item);↵ | |
10 | }↵ | 10 | }↵ | |
11 | else {↵ | 11 | else {↵ | |
12 | this.data.add(item);↵ | 12 | this.data.add(item);↵ | |
13 | }↵ | 13 | }↵ | |
14 | }↵ | 14 | }↵ | |
15 | else {↵ | 15 | else {↵ | |
16 | throw new SeriesException("X-value already exists.");↵ | 16 | throw new SeriesException("X-value already exists.");↵ | |
17 | } | 17 |
| |
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.9 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 25 |
Number of mapped statements | 8 |
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) | 9.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7 | if (this.allowDuplicateXValues) | 7 | if (this.allowDuplicateXValues) | ||||||||||||
8 | int size = this.data.size(); | 8 | int size = this.data.size(); | ||||||||||||
9 | while (index < size && item.compareTo(this.data.get(index)) == 0) |
| 9 | while (index < size && item.compareTo(this.data.get(index)) == 0) | |||||||||||
10 | index++; | 10 | index++; | ||||||||||||
11 | if (index < this.data.size()) | 11 | if (index < this.data.size()) | ||||||||||||
12 | this.data.add(index, item); |
| 12 | this.data.add(index, item); | |||||||||||
else | else | ||||||||||||||
13 | this.data.add(item); |
| 13 | this.data.add(item); | |||||||||||
else | else | ||||||||||||||
14 | throw new SeriesException("X-value already exists."); | 14 | throw new SeriesException("X-value already exists."); |
Row | Violation |
---|---|
1 | Type org.jfree.data.ComparableObjectItem of variable item does not match with type org.jfree.data.xy.XYDataItem of variable item |
2 | Type org.jfree.data.ComparableObjectItem of variable item does not match with type org.jfree.data.xy.XYDataItem of variable item |
3 | Type org.jfree.data.ComparableObjectItem of variable item does not match with type org.jfree.data.xy.XYDataItem of variable item |