if (this.equals(DateTickMarkPosition.START)) { return DateTickMarkPosition.START; } else if (this.equals(DateTickMarkPosition.MIDDLE)) { return DateTickMarkPosition.MIDDLE; } else if (this.equals(DateTickMarkPosition.END)) { return DateTickMarkPosition.END; } return null;
if (this.equals(LengthConstraintType.NONE)) { return LengthConstraintType.NONE; } else if (this.equals(LengthConstraintType.RANGE)) { return LengthConstraintType.RANGE; } else if (this.equals(LengthConstraintType.FIXED)) { return LengthConstraintType.FIXED; } return null;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateTickMarkPosition.java File path: /jfreechart-1.0.10/src/org/jfree/chart/block/LengthConstraintType.java
Method name: Object readResolve() Method name: Object readResolve()
Number of AST nodes: 7 Number of AST nodes: 7
1
if (this.equals(DateTickMarkPosition.START)) {
1
if (this.equals(
2
            return DateTickMarkPosition.START
2
LengthConstraintType.NONE)) {
3
;
3
            return LengthConstraintType.NONE;
4
        }
4
        }
5
        else if (this.equals(DateTickMarkPosition.MIDDLE)) {
5
        else if (this.equals(
6
            return DateTickMarkPosition.MIDDL
6
LengthConstraintType.RANGE)) {
7
E;
7
            return LengthConstraintType.RANGE;
8
        }    
8
        }
9
        else if (this.equals(DateTickMarkPosition.END)) {
9
        else if (this.equals(LengthConstraintType.FIXED)) {
10
            return DateTickMarkPosition.END;
10
            return LengthConstraintType.FIXED;
11
        }    
11
        }
12
        return null;
12
        return null;
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)0.9
Clones locationClones are in different classes
Number of node comparisons28
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)1.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this.equals(DateTickMarkPosition.START))
    1
    if (this.equals(DateTickMarkPosition.START))
    1
    if (this.equals(LengthConstraintType.NONE))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateTickMarkPositionorg.jfree.chart.block.LengthConstraintTypeVARIABLE_TYPE_MISMATCH
    STARTNONEVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickMarkPositionorg.jfree.chart.block.LengthConstraintTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.DateTickMarkPosition does not match with type org.jfree.chart.block.LengthConstraintType
    • Make classes org.jfree.chart.axis.DateTickMarkPosition and org.jfree.chart.block.LengthConstraintType extend a common superclass
    Type org.jfree.chart.axis.DateTickMarkPosition of variable DateTickMarkPosition.START does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.NONE
    • Make classes org.jfree.chart.axis.DateTickMarkPosition and org.jfree.chart.block.LengthConstraintType extend a common superclass
    1
    if (this.equals(LengthConstraintType.NONE))
                                                                            
    2
    return LengthConstraintType.NONE;
    Preondition Violations
    Unmatched return LengthConstraintType.NONE;
    2
    return LengthConstraintType.NONE;
    2
    return DateTickMarkPosition.START;
    2
    return DateTickMarkPosition.START;
    Preondition Violations
    Unmatched return DateTickMarkPosition.START;
                                                                              
    3
    else if (this.equals(DateTickMarkPosition.MIDDLE))
    3
    else if (this.equals(DateTickMarkPosition.MIDDLE))
    3
    else if (this.equals(LengthConstraintType.RANGE))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateTickMarkPositionorg.jfree.chart.block.LengthConstraintTypeVARIABLE_TYPE_MISMATCH
    MIDDLERANGEVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickMarkPositionorg.jfree.chart.block.LengthConstraintTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.DateTickMarkPosition does not match with type org.jfree.chart.block.LengthConstraintType
    • Make classes org.jfree.chart.axis.DateTickMarkPosition and org.jfree.chart.block.LengthConstraintType extend a common superclass
    Type org.jfree.chart.axis.DateTickMarkPosition of variable DateTickMarkPosition.MIDDLE does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.RANGE
    • Make classes org.jfree.chart.axis.DateTickMarkPosition and org.jfree.chart.block.LengthConstraintType extend a common superclass
    3
    else if (this.equals(LengthConstraintType.RANGE))
                                                                              
    4
    return LengthConstraintType.RANGE;
    Preondition Violations
    Unmatched return LengthConstraintType.RANGE;
    4
    return LengthConstraintType.RANGE;
    4
    return DateTickMarkPosition.MIDDLE;
    4
    return DateTickMarkPosition.MIDDLE;
    Preondition Violations
    Unmatched return DateTickMarkPosition.MIDDLE;
                                                                                
    5
    else if (this.equals(DateTickMarkPosition.END))
    5
    else if (this.equals(DateTickMarkPosition.END))
    5
    else if (this.equals(LengthConstraintType.FIXED))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.DateTickMarkPositionorg.jfree.chart.block.LengthConstraintTypeVARIABLE_TYPE_MISMATCH
    ENDFIXEDVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.DateTickMarkPositionorg.jfree.chart.block.LengthConstraintTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.DateTickMarkPosition does not match with type org.jfree.chart.block.LengthConstraintType
    • Make classes org.jfree.chart.axis.DateTickMarkPosition and org.jfree.chart.block.LengthConstraintType extend a common superclass
    Type org.jfree.chart.axis.DateTickMarkPosition of variable DateTickMarkPosition.END does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.FIXED
    • Make classes org.jfree.chart.axis.DateTickMarkPosition and org.jfree.chart.block.LengthConstraintType extend a common superclass
    5
    else if (this.equals(LengthConstraintType.FIXED))
                                                                              
    6
    return LengthConstraintType.FIXED;
    Preondition Violations
    Unmatched return LengthConstraintType.FIXED;
    6
    return LengthConstraintType.FIXED;
    6
    return DateTickMarkPosition.END;
    6
    return DateTickMarkPosition.END;
    Preondition Violations
    Unmatched return DateTickMarkPosition.END;
                                                                          
    7
    return null;
    7
    return null;
    Precondition Violations (12)
    Row Violation
    1Type org.jfree.chart.axis.DateTickMarkPosition does not match with type org.jfree.chart.block.LengthConstraintType
    2Type org.jfree.chart.axis.DateTickMarkPosition of variable DateTickMarkPosition.START does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.NONE
    3Unmatched return LengthConstraintType.NONE;
    4Unmatched return DateTickMarkPosition.START;
    5Type org.jfree.chart.axis.DateTickMarkPosition does not match with type org.jfree.chart.block.LengthConstraintType
    6Type org.jfree.chart.axis.DateTickMarkPosition of variable DateTickMarkPosition.MIDDLE does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.RANGE
    7Unmatched return LengthConstraintType.RANGE;
    8Unmatched return DateTickMarkPosition.MIDDLE;
    9Type org.jfree.chart.axis.DateTickMarkPosition does not match with type org.jfree.chart.block.LengthConstraintType
    10Type org.jfree.chart.axis.DateTickMarkPosition of variable DateTickMarkPosition.END does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.FIXED
    11Unmatched return LengthConstraintType.FIXED;
    12Unmatched return DateTickMarkPosition.END;