1634-1-2

int seriesIndex = indexOf(seriesKey); if (seriesIndex >= 0) { this.seriesKeys.remove(seriesIndex); this.seriesList.remove(seriesIndex); notifyListeners(new DatasetChangeEvent(this, this)); }
int seriesIndex = indexOf(seriesKey); if (seriesIndex >= 0) { this.seriesKeys.remove(seriesIndex); this.seriesList.remove(seriesIndex); notifyListeners(new DatasetChangeEvent(this, this)); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/xy/DefaultXYDataset.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/DefaultXYZDataset.java
Method name: `void removeSeries(Comparable)` |  | Method name: `void removeSeries(Comparable)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    int seriesIndex = indexOf(seriesKey);↵

1

    int seriesIndex = indexOf(seriesKey);↵

2

            if (seriesIndex >= 0) {↵

2

            if (seriesIndex >= 0) {↵

3

                this.seriesKeys.remove(seriesIndex);↵

3

                this.seriesKeys.remove(seriesIndex);↵

4

                this.seriesList.remove(seriesIndex);↵

4

                this.seriesList.remove(seriesIndex);↵

5

                notifyListeners(new DatasetChangeEvent(this, this));↵

5

                notifyListeners(new DatasetChangeEvent(this, this));↵

6

            }

6

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
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 having the same super class
Number of node comparisons | 17

1. {Refactorable}

   Mapping Summary
   Number of mapped statements | 5
   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) | 1.0
   Clone type | Type 1

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       int seriesIndex = indexOf(seriesKey);

   1

       int seriesIndex = indexOf(seriesKey);

   2

       if (seriesIndex >= 0)

   2

       if (seriesIndex >= 0)

   3

       this.seriesKeys.remove(seriesIndex);

   3

       this.seriesKeys.remove(seriesIndex);

   4

       this.seriesList.remove(seriesIndex);

   4

       this.seriesList.remove(seriesIndex);

   5

       notifyListeners(new DatasetChangeEvent(this, this));

   5

       notifyListeners(new DatasetChangeEvent(this, this));

   Precondition Violations (0)
   Row | Violation
   --- | ---