1306-1-2

if (this.quarter > FIRST_QUARTER) { result = new Quarter(this.quarter - 1, this.year); } else { if (this.year > 1900) { result = new Quarter(LAST_QUARTER, this.year - 1); } else { result = null; } }
if (this.quarter < LAST_QUARTER) { result = new Quarter(this.quarter + 1, this.year); } else { if (this.year < 9999) { result = new Quarter(FIRST_QUARTER, this.year + 1); } else { result = null; } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/Quarter.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/time/Quarter.java
Method name: `RegularTimePeriod previous()` |  | Method name: `RegularTimePeriod next()`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    if (this.quarter &gt; FIRST_QUARTER) {↵

1

    if (this.quarter &lt; LAST_QUARTER) {↵

2

                result = new Quarter(this.quarter - 1, this.year);↵

2

                result = new Quarter(this.quarter + 1, this.year);↵

3

            }↵

3

            }↵

4

            else {↵

4

            else {↵

5

                if (this.year &gt; 1900) {↵

5

                if (this.year &lt; 9999) {↵

6

                    result = new Quarter(LAST_QUARTER, this.year - 1);↵

6

                    result = new Quarter(FIRST_QUARTER, this.year + 1);↵

7

                }↵

7

                }↵

8

                else {↵

8

                else {↵

9

                    result = null;↵

9

                    result = null;↵

10

                }↵

10

                }↵

11

            }

11

            }

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 declared in the same class
Number of node comparisons | 1