326-1-2

Day result; int serial = this.serialDate.toSerial(); if (serial > SerialDate.SERIAL_LOWER_BOUND) { SerialDate yesterday = SerialDate.createInstance(serial - 1); return new Day(yesterday); } else { result = null; } return result;
Day result; int serial = this.serialDate.toSerial(); if (serial < SerialDate.SERIAL_UPPER_BOUND) { SerialDate tomorrow = SerialDate.createInstance(serial + 1); return new Day(tomorrow); } else { result = null; } return result;

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

1

    Day result;↵

1

    Day result;↵

2

            int serial = this.serialDate.toSerial();↵

2

            int serial = this.serialDate.toSerial();↵

3

            if (serial &gt; SerialDate.SERIAL_LOWER_BOUND) {↵

3

            if (serial &lt; SerialDate.SERIAL_UPPER_BOUND) {↵

4

                SerialDate yesterday = SerialDate.createInstance(serial - 1);↵

4

                SerialDate tomorrow = SerialDate.createInstance(serial + 1);↵

5

                return new Day(yesterday);↵

5

                return new Day(tomorrow);↵

6

            }↵

6

            }↵

7

            else {↵

7

            else {↵

8

                result = null;↵

8

                result = null;↵

9

            }↵

9

            }↵

10

            return result;

10

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