1069-1-2

if (this.tickMarkPosition == DateTickMarkPosition.START) { minutes = 0; seconds = 0; } else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) { minutes = 30; seconds = 0; } else { minutes = 59; seconds = 59; }
if (this.tickMarkPosition == DateTickMarkPosition.START) { months = 0; days = 1; } else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) { months = 6; days = 1; } else { months = 11; days = 31; }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java
Method name: `Date previousStandardDate(Date, DateTickUnit)` |  | Method name: `Date previousStandardDate(Date, DateTickUnit)`
Number of AST nodes: 8 |  | Number of AST nodes: 8

1

    if (this.tickMarkPosition == DateTickMarkPosition.START) {↵

1

    if (this.tickMarkPosition == DateTickMarkPosition.START) {↵

2

                        minutes = 0;↵

2

                        months = 0;↵

3

                        seconds = 0;↵

3

                        days = 1;↵

4

                    }↵

4

                    }↵

5

                    else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {↵

5

                    else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE) {↵

6

                        minutes = 30;↵

6

                        months = 6;↵

7

                        seconds = 0;↵

7

                        days = 1;↵

8

                    }↵

8

                    }↵

9

                    else {↵

9

                    else {↵

10

                        minutes = 59;↵

10

                        months = 11;↵

11

                        seconds = 59;↵

11

                        days = 31;↵

12

                    }

12

                    }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.6
Clones location | Clones are in the same method
Number of node comparisons | 51

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   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) | 9.4
   Clone type | Type 2

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

   67

       if (this.tickMarkPosition == DateTickMarkPosition.START)

   115

       if (this.tickMarkPosition == DateTickMarkPosition.START)

   68

       minutes = 0;

   68 | minutes = 0;
   117 | days = 1;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   minutes | days | VARIABLE_NAME_MISMATCH
   0 | 1 | LITERAL_VALUE_MISMATCH

   117

       days = 1;

   69

       seconds = 0;

   69 | seconds = 0;
   116 | months = 0;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seconds | months | VARIABLE_NAME_MISMATCH

   116

       months = 0;

   70

       else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE)

   118

       else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE)

   71

       minutes = 30;

   71 | minutes = 30;
   120 | days = 1;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   minutes | days | VARIABLE_NAME_MISMATCH
   30 | 1 | LITERAL_VALUE_MISMATCH

   120

       days = 1;

   72

       seconds = 0;

   72 | seconds = 0;
   119 | months = 6;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seconds | months | VARIABLE_NAME_MISMATCH
   0 | 6 | LITERAL_VALUE_MISMATCH

   119

       months = 6;

       else

       else

   73

       minutes = 59;

   73 | minutes = 59;
   122 | days = 31;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   minutes | days | VARIABLE_NAME_MISMATCH
   59 | 31 | LITERAL_VALUE_MISMATCH

   122

       days = 31;

   74

       seconds = 59;

   74 | seconds = 59;
   121 | months = 11;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   seconds | months | VARIABLE_NAME_MISMATCH
   59 | 11 | LITERAL_VALUE_MISMATCH

   121

       months = 11;

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Clone fragment #1 returns variables minutes, seconds , while Clone fragment #2 returns variables months, days