if (this.allowDuplicateXValues) { // need to make sure we are adding *after* any duplicates int size = this.data.size(); while (index < size && item.compareTo(this.data.get(index)) == 0) { index++; } if (index < this.data.size()) { this.data.add(index, item); } else { this.data.add(item); } } else { throw new SeriesException("X-value already exists."); }
if (this.allowDuplicateXValues) { // need to make sure we are adding *after* any duplicates int size = this.data.size(); while (index < size && item.compareTo(this.data.get(index)) == 0) { index++; } if (index < this.data.size()) { this.data.add(index, item); } else { this.data.add(item); } } else { throw new SeriesException("X-value already exists."); }
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.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
                }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0