274-1-3

if (this.data.size() > 0) { for (int index = start; index <= end; index++) { TimePeriodValue item = (TimePeriodValue) this.data.get(index); TimePeriodValue clone = (TimePeriodValue) item.clone(); try { copy.add(clone); } catch (SeriesException e) { System.err.println("Failed to add cloned item."); } } }
if (this.data.size() > 0) { for (int index = start; index <= end; index++) { TimeSeriesDataItem item = (TimeSeriesDataItem) this.data.get(index); TimeSeriesDataItem clone = (TimeSeriesDataItem) item.clone(); try { copy.add(clone); } catch (SeriesException e) { e.printStackTrace(); } } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimePeriodValues.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimeSeries.java
Method name: `TimePeriodValues createCopy(int, int)` |  | Method name: `TimeSeries createCopy(int, int)`
Number of AST nodes: 6 |  | Number of AST nodes: 6

1

    if (this.data.size() > 0) {↵

1

    if (this.data.size() > 0) {↵

2

                for (int index = start; index <= end; index++) {↵

2

                for (int index = start; index <= end; index++) {↵

3

                    TimePeriodValue item↵

3

                    TimeSeriesDataItem item↵

4

     = (TimePeriodValue) this.data.get(index);↵

4

                        = (TimeSeriesDataItem) this.data.get(index);↵

5

                    TimePeriodValue clone = (TimePeriodValue) item.clone();↵

5

                    TimeSeriesDataItem clone = (TimeSeriesDataItem) item.clone();↵

6

                    try {↵

6

                    try {↵

7

                        copy.add(clone);↵

7

                        copy.add(clone);↵

8

                    }↵

8

                    }↵

9

                    catch (SeriesException e) {↵

9

                    catch (SeriesException e) {↵

10

                        System.err.println("Failed to add cloned item.");↵

10

                        e.printStackTrace();↵

11

                    }↵

11

                    }↵

12

                }↵

12

                }↵

13

            }

13

            }

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.3
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 1