AxisLocation location = getDomainAxisLocation(index); RectangleEdge result = Plot.resolveDomainAxisLocation(location, this.orientation); if (result == null) { result = RectangleEdge.opposite(getDomainAxisEdge()); } return result;
AxisLocation location = getRangeAxisLocation(index); RectangleEdge result = Plot.resolveRangeAxisLocation(location, this.orientation); if (result == null) { result = RectangleEdge.opposite(getRangeAxisEdge()); } return result;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/XYPlot.java
Method name: RectangleEdge getDomainAxisEdge(int) Method name: RectangleEdge getRangeAxisEdge(int)
Number of AST nodes: 5 Number of AST nodes: 5
1
AxisLocation location = getDomainAxisLocation(index);
1
AxisLocation location = getRangeAxisLocation(index);
2
        RectangleEdge result = Plot.resolveDomainAxisLocation(location,
2
        RectangleEdge result = Plot.resolveRangeAxisLocation(location,
3
                this.orientation);
3
                this.orientation);
4
        if (result == null) {
4
        if (result == null) {
5
            result = RectangleEdge.opposite(getDomainAxisEdge());
5
            result = RectangleEdge.opposite(getRangeAxisEdge());
6
        }
6
        }
7
        return result;
7
        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.1
Clones locationClones are declared in the same class
Number of node comparisons13
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)20.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    AxisLocation location = getDomainAxisLocation(index);
    1
    AxisLocation location = getDomainAxisLocation(index);
    1
    AxisLocation location = getRangeAxisLocation(index);
    Differences
    Expression1Expression2Difference
    getDomainAxisLocationgetRangeAxisLocationMETHOD_INVOCATION_NAME_MISMATCH
    1
    AxisLocation location = getRangeAxisLocation(index);
    2
    RectangleEdge result = Plot.resolveDomainAxisLocation(location, this.orientation);
    2
    RectangleEdge result = Plot.resolveDomainAxisLocation(location, this.orientation);
    2
    RectangleEdge result = Plot.resolveRangeAxisLocation(location, this.orientation);
    Differences
    Expression1Expression2Difference
    resolveDomainAxisLocationresolveRangeAxisLocationMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression Plot.resolveDomainAxisLocation(location,this.orientation) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression Plot.resolveRangeAxisLocation(location,this.orientation) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    RectangleEdge result = Plot.resolveRangeAxisLocation(location, this.orientation);
    3
    if (result == null)
    3
    if (result == null)
    4
    result = RectangleEdge.opposite(getDomainAxisEdge());
    4
    result = RectangleEdge.opposite(getDomainAxisEdge());
    4
    result = RectangleEdge.opposite(getRangeAxisEdge());
    Differences
    Expression1Expression2Difference
    getDomainAxisEdgegetRangeAxisEdgeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getDomainAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    Expression getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4
    result = RectangleEdge.opposite(getRangeAxisEdge());
    5
    return result;
    5
    return result;
    Precondition Violations (4)
    Row Violation
    1Expression Plot.resolveDomainAxisLocation(location,this.orientation) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression Plot.resolveRangeAxisLocation(location,this.orientation) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression getDomainAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted
    4Expression getRangeAxisEdge() is a method call throwing exception(s) that should be caught by a try block that will be extracted