AxisLocation result = null; if (index < this.rangeAxisLocations.size()) { result = (AxisLocation) this.rangeAxisLocations.get(index); } if (result == null) { result = AxisLocation.getOpposite(getRangeAxisLocation(0)); } return result;
AxisLocation result = null; if (index < this.rangeAxisLocations.size()) { result = (AxisLocation) this.rangeAxisLocations.get(index); } if (result == null) { result = AxisLocation.getOpposite(getRangeAxisLocation()); } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CategoryPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: AxisLocation getRangeAxisLocation(int) Method name: AxisLocation getRangeAxisLocation(int)
Number of AST nodes: 6 Number of AST nodes: 6
1
AxisLocation result = null;
1
AxisLocation result = null;
2
        if (index < this.rangeAxisLocations.size()) {
2
        if (index < this.rangeAxisLocations.size()) {
3
            result = (AxisLocation) this.rangeAxisLocations.get(index);
3
            result = (AxisLocation) this.rangeAxisLocations.get(index);
4
        }
4
        }
5
        if (result == null) {
5
        if (result == null) {
6
            result = AxisLocation.getOpposite(getRangeAxisLocation(0));
6
            result = AxisLocation.getOpposite(getRangeAxisLocation());
7
        }
7
        }
8
        return result;
8
        return result;
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.9
Clones locationClones are in different classes having the same super class
Number of node comparisons14
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    AxisLocation result = null;
    1
    AxisLocation result = null;
    2
    if (index < this.rangeAxisLocations.size())
    2
    if (index < this.rangeAxisLocations.size())
    3
    result = (AxisLocation)this.rangeAxisLocations.get(index);
    3
    result = (AxisLocation)this.rangeAxisLocations.get(index);
    4
    if (result == null)
    4
    if (result == null)
    5
    result = AxisLocation.getOpposite(getRangeAxisLocation(0));
    5
    result = AxisLocation.getOpposite(getRangeAxisLocation(0));
    5
    result = AxisLocation.getOpposite(getRangeAxisLocation());
    Differences
    Expression1Expression2Difference
    getRangeAxisLocation(0)getRangeAxisLocation()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression getRangeAxisLocation(0) is a method call throwing exception(s) that should be caught by a try block that will be extracted
    5
    result = AxisLocation.getOpposite(getRangeAxisLocation());
    6
    return result;
    6
    return result;
    Precondition Violations (1)
    Row Violation
    1Expression getRangeAxisLocation(0) is a method call throwing exception(s) that should be caught by a try block that will be extracted