1294-1-2

int result = -1; for (int i = 0; i < this.datasets.size(); i++) { if (dataset == this.datasets.get(i)) { result = i; break; } } return result;
int result = -1; for (int i = 0; i < this.seriesKeys.length; i++) { if (seriesKey.equals(this.seriesKeys[i])) { result = i; break; } } return result;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/category/DefaultIntervalCategoryDataset.java
Method name: `int indexOf(XYDataset)` |  | Method name: `int getSeriesIndex(Comparable)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    int result = -1;↵

1

    int result = -1;↵

2

            for (int i = 0; i < this.datasets.size(); i++) {↵

2

            for (int i = 0; i < this.seriesKeys.length; i++) {↵

3

                if (dataset == this.datasets.get(i)) {↵

3

                if (seriesKey.equals(this.seriesKeys[i])) {↵

4

                    result = i;↵

4

                    result = i;↵

5

                    break;↵

5

                    break;↵

6

                }↵

6

                }↵

7

            }↵

7

            }↵

8

            return result;

8

            return result;

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.1
Clones location | Clones are in different classes
Number of node comparisons | 1