if (fixed != null) { if (orientation == PlotOrientation.HORIZONTAL) { space.setLeft(fixed.getLeft()); space.setRight(fixed.getRight()); } else if (orientation == PlotOrientation.VERTICAL) { space.setTop(fixed.getTop()); space.setBottom(fixed.getBottom()); } } else { ValueAxis xAxis = getDomainAxis(); RectangleEdge xEdge = Plot.resolveDomainAxisLocation( getDomainAxisLocation(), orientation); if (xAxis != null) { space = xAxis.reserveSpace(g2, this, plotArea, xEdge, space); } }
if (fixed != null) { if (orientation == PlotOrientation.VERTICAL) { space.setLeft(fixed.getLeft()); space.setRight(fixed.getRight()); } else if (orientation == PlotOrientation.HORIZONTAL) { space.setTop(fixed.getTop()); space.setBottom(fixed.getBottom()); } } else { ValueAxis valueAxis = getRangeAxis(); RectangleEdge valueEdge = Plot.resolveRangeAxisLocation( getRangeAxisLocation(), orientation ); if (valueAxis != null) { space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space); } }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedDomainXYPlot.java File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/CombinedRangeXYPlot.java
Method name: AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D) Method name: AxisSpace calculateAxisSpace(Graphics2D, Rectangle2D)
Number of AST nodes: 11 Number of AST nodes: 11
1
if (fixed != null) {
1
if (fixed != null) {
2
            if (orientation == PlotOrientation.HORIZONTAL) {
2
            if (orientation == PlotOrientation.VERTICAL) {
3
                space.setLeft(fixed.getLeft());
3
                space.setLeft(fixed.getLeft());
4
                space.setRight(fixed.getRight());
4
                space.setRight(fixed.getRight());
5
            }
5
            }
6
            else if (orientation == PlotOrientation.VERTICAL) {
6
            else if (orientation == PlotOrientation.HORIZONTAL) {
7
                space.setTop(fixed.getTop());
7
                space.setTop(fixed.getTop());
8
                space.setBottom(fixed.getBottom());
8
                space.setBottom(fixed.getBottom());
9
            }
9
            }
10
        }
10
        }
11
        else {
11
        else {
12
            ValueAxis xAxis = getDomainAxis();
12
            ValueAxis valueAxis = getRangeAxis();
13
            RectangleEdge xEdge = Plot.resolveDomainAxisLocation(
13
            RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(
14
                    getDomainAxisLocation(), orientation
14
                getRangeAxisLocation(), orientation
15
);
15
            );
16
            if (xAxis != null) {
16
            if (valueAxis != null) {
17
                space = xAxis.reserveSpace(g2, this, plotArea, xEdge,
17
                space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge,
18
 space);
18
                        space);
19
            }
19
            }
20
        }
20
        }
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.8
Clones locationClones are in different classes having the same super class
Number of node comparisons50
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    if (fixed != null)
    4
    if (fixed != null)
    5
    if (orientation == PlotOrientation.HORIZONTAL)
    5
    if (orientation == PlotOrientation.HORIZONTAL)
    5
    if (orientation == PlotOrientation.VERTICAL)
    Differences
    Expression1Expression2Difference
    HORIZONTALVERTICALVARIABLE_NAME_MISMATCH
    5
    if (orientation == PlotOrientation.VERTICAL)
    6
    space.setLeft(fixed.getLeft());
    6
    space.setLeft(fixed.getLeft());
    7
    space.setRight(fixed.getRight());
    7
    space.setRight(fixed.getRight());
    8
    else if (orientation == PlotOrientation.VERTICAL)
    8
    else if (orientation == PlotOrientation.VERTICAL)
    8
    else if (orientation == PlotOrientation.HORIZONTAL)
    Differences
    Expression1Expression2Difference
    VERTICALHORIZONTALVARIABLE_NAME_MISMATCH
    8
    else if (orientation == PlotOrientation.HORIZONTAL)
    9
    space.setTop(fixed.getTop());
    9
    space.setTop(fixed.getTop());
    10
    space.setBottom(fixed.getBottom());
    10
    space.setBottom(fixed.getBottom());
    else
    else
    11
    ValueAxis xAxis = getDomainAxis();
    11
    ValueAxis xAxis = getDomainAxis();
    11
    ValueAxis valueAxis = getRangeAxis();
    Differences
    Expression1Expression2Difference
    xAxisvalueAxisVARIABLE_NAME_MISMATCH
    getDomainAxisgetRangeAxisMETHOD_INVOCATION_NAME_MISMATCH
    11
    ValueAxis valueAxis = getRangeAxis();
    12
    RectangleEdge xEdge = Plot.resolveDomainAxisLocation(getDomainAxisLocation(), orientation);
    12
    RectangleEdge xEdge = Plot.resolveDomainAxisLocation(getDomainAxisLocation(), orientation);
    12
    RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(getRangeAxisLocation(), orientation);
    Differences
    Expression1Expression2Difference
    xEdgevalueEdgeVARIABLE_NAME_MISMATCH
    resolveDomainAxisLocationresolveRangeAxisLocationMETHOD_INVOCATION_NAME_MISMATCH
    getDomainAxisLocationgetRangeAxisLocationMETHOD_INVOCATION_NAME_MISMATCH
    12
    RectangleEdge valueEdge = Plot.resolveRangeAxisLocation(getRangeAxisLocation(), orientation);
    13
    if (xAxis != null)
    13
    if (xAxis != null)
    13
    if (valueAxis != null)
    Differences
    Expression1Expression2Difference
    xAxisvalueAxisVARIABLE_NAME_MISMATCH
    13
    if (valueAxis != null)
    14
    space = xAxis.reserveSpace(g2, this, plotArea, xEdge, space);
    14
    space = xAxis.reserveSpace(g2, this, plotArea, xEdge, space);
    14
    space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space);
    Differences
    Expression1Expression2Difference
    xEdgevalueEdgeVARIABLE_NAME_MISMATCH
    xAxisvalueAxisVARIABLE_NAME_MISMATCH
    14
    space = valueAxis.reserveSpace(g2, this, plotArea, valueEdge, space);
    Precondition Violations (0)
    Row Violation