Object result = null; if (this.equals(TickType.MAJOR)) { result = TickType.MAJOR; } else if (this.equals(TickType.MINOR)) { result = TickType.MINOR; } return result;
Object result = null; if (this.equals(PlotOrientation.HORIZONTAL)) { result = PlotOrientation.HORIZONTAL; } else if (this.equals(PlotOrientation.VERTICAL)) { result = PlotOrientation.VERTICAL; } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/TickType.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/PlotOrientation.java
Method name: Object readResolve() Method name: Object readResolve()
Number of AST nodes: 6 Number of AST nodes: 6
1
Object result = null;
1
Object result = null;
2
        if (this.equals(TickType.MAJOR)) {
2
        if (this.equals(PlotOrientation.HORIZONTAL)) {
3
            result = TickType.MAJOR;
3
            result = PlotOrientation.HORIZONTAL;
4
        }
4
        }
5
        else if (this.equals(TickType.MINOR)) {
5
        else if (this.equals(PlotOrientation.VERTICAL)) {
6
            result = TickType.MINOR;
6
            result = PlotOrientation.VERTICAL;
7
        }
7
        }
8
        return result;
8
        return result;
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.4
Clones locationClones are in different classes
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    Object result = null;
    1
    Object result = null;
    2
    if (this.equals(TickType.MAJOR))
    2
    if (this.equals(TickType.MAJOR))
    2
    if (this.equals(PlotOrientation.HORIZONTAL))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.TickTypeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    MAJORHORIZONTALVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.TickTypeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.TickType does not match with type org.jfree.chart.plot.PlotOrientation
    • Make classes org.jfree.chart.axis.TickType and org.jfree.chart.plot.PlotOrientation extend a common superclass
    Type org.jfree.chart.axis.TickType of variable TickType.MAJOR does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL
    • Make classes org.jfree.chart.axis.TickType and org.jfree.chart.plot.PlotOrientation extend a common superclass
    2
    if (this.equals(PlotOrientation.HORIZONTAL))
                                                                              
    3
    result = PlotOrientation.HORIZONTAL;
    Preondition Violations
    Unmatched statement result=PlotOrientation.HORIZONTAL; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    3
    result = PlotOrientation.HORIZONTAL;
    3
    result = TickType.MAJOR;
    3
    result = TickType.MAJOR;
    Preondition Violations
    Unmatched statement result=TickType.MAJOR; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                      
    4
    else if (this.equals(TickType.MINOR))
    4
    else if (this.equals(TickType.MINOR))
    4
    else if (this.equals(PlotOrientation.VERTICAL))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.TickTypeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    MINORVERTICALVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.TickTypeorg.jfree.chart.plot.PlotOrientationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.TickType does not match with type org.jfree.chart.plot.PlotOrientation
    • Make classes org.jfree.chart.axis.TickType and org.jfree.chart.plot.PlotOrientation extend a common superclass
    Type org.jfree.chart.axis.TickType of variable TickType.MINOR does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL
    • Make classes org.jfree.chart.axis.TickType and org.jfree.chart.plot.PlotOrientation extend a common superclass
    4
    else if (this.equals(PlotOrientation.VERTICAL))
                                                                          
    5
    result = PlotOrientation.VERTICAL;
    Preondition Violations
    Unmatched statement result=PlotOrientation.VERTICAL; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    result = PlotOrientation.VERTICAL;
    5
    result = TickType.MINOR;
    5
    result = TickType.MINOR;
    Preondition Violations
    Unmatched statement result=TickType.MINOR; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                      
    6
    return result;
    6
    return result;
    Precondition Violations (8)
    Row Violation
    1Type org.jfree.chart.axis.TickType does not match with type org.jfree.chart.plot.PlotOrientation
    2Type org.jfree.chart.axis.TickType of variable TickType.MAJOR does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL
    3Unmatched statement result=PlotOrientation.HORIZONTAL; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement result=TickType.MAJOR; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Type org.jfree.chart.axis.TickType does not match with type org.jfree.chart.plot.PlotOrientation
    6Type org.jfree.chart.axis.TickType of variable TickType.MINOR does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL
    7Unmatched statement result=PlotOrientation.VERTICAL; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement result=TickType.MINOR; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted