1334-1-2

public Date addToDate(Date base, TimeZone zone) { // as far as I know, the Locale for the calendar only affects week // number calculations, and since DateTickUnit doesn't do week // arithmetic, the default locale (whatever it is) should be fine // here... Calendar calendar = Calendar.getInstance(zone); calendar.setTime(base); calendar.add(getCalendarField(this.unit), this.count); return calendar.getTime();
public Date rollDate(Date base, TimeZone zone) { // as far as I know, the Locale for the calendar only affects week // number calculations, and since DateTickUnit doesn't do week // arithmetic, the default locale (whatever it is) should be fine // here... Calendar calendar = Calendar.getInstance(zone); calendar.setTime(base); calendar.add(getCalendarField(this.rollUnit), this.rollCount); return calendar.getTime();

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateTickUnit.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateTickUnit.java
Method name: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    public Date addToDate(Date base, TimeZone zone) {↵

1

    public Date rollDate(Date base, TimeZone zone) {↵

2

            // as far as I know, the Locale for the calendar only affects week↵

2

            // as far as I know, the Locale for the calendar only affects week↵

3

        	// number calculations, and since DateTickUnit doesn't do week↵

3

        	// number calculations, and since DateTickUnit doesn't do week↵

4

        	// arithmetic, the default locale (whatever it is) should be fine↵

4

        	// arithmetic, the default locale (whatever it is) should be fine↵

5

        	// here...↵

5

        	// here...↵

6

        	Calendar calendar = Calendar.getInstance(zone);↵

6

            Calendar calendar = Calendar.getInstance(zone);↵

7

            calendar.setTime(base);↵

7

            calendar.setTime(base);↵

8

            calendar.add(getCalendarField(this.unit), this.count);↵

8

            calendar.add(getCalendarField(this.rollUnit), this.rollCount);↵

9

            return calendar.getTime();↵

9

            return calendar.getTime();↵

10

10

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.0
Clones location |
Number of node comparisons | 0