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
                }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)4.4
Clones locationClones are in the same method
Number of node comparisons51
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.7
    Clone typeType 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;
    116
    months = 0;
    Differences
    Expression1Expression2Difference
    minutesmonthsVARIABLE_NAME_MISMATCH
    116
    months = 0;
    69
    seconds = 0;
    69
    seconds = 0;
    117
    days = 1;
    Differences
    Expression1Expression2Difference
    secondsdaysVARIABLE_NAME_MISMATCH
    01LITERAL_VALUE_MISMATCH
    117
    days = 1;
    70
    else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE)
    118
    else if (this.tickMarkPosition == DateTickMarkPosition.MIDDLE)
    71
    minutes = 30;
    71
    minutes = 30;
    119
    months = 6;
    Differences
    Expression1Expression2Difference
    minutesmonthsVARIABLE_NAME_MISMATCH
    306LITERAL_VALUE_MISMATCH
    119
    months = 6;
    72
    seconds = 0;
    72
    seconds = 0;
    120
    days = 1;
    Differences
    Expression1Expression2Difference
    secondsdaysVARIABLE_NAME_MISMATCH
    01LITERAL_VALUE_MISMATCH
    120
    days = 1;
    else
    else
    73
    minutes = 59;
    73
    minutes = 59;
    121
    months = 11;
    Differences
    Expression1Expression2Difference
    minutesmonthsVARIABLE_NAME_MISMATCH
    5911LITERAL_VALUE_MISMATCH
    121
    months = 11;
    74
    seconds = 59;
    74
    seconds = 59;
    122
    days = 31;
    Differences
    Expression1Expression2Difference
    secondsdaysVARIABLE_NAME_MISMATCH
    5931LITERAL_VALUE_MISMATCH
    122
    days = 31;
    Precondition Violations (1)
    Row Violation
    1Clone fragment #1 returns variables minutes, seconds , while Clone fragment #2 returns variables months, days