if (this.fixedDomainAxisSpace != null) { if (this.orientation == PlotOrientation.HORIZONTAL) { space.ensureAtLeast(this.fixedDomainAxisSpace.getLeft(), RectangleEdge.LEFT); space.ensureAtLeast(this.fixedDomainAxisSpace.getRight(), RectangleEdge.RIGHT); } else if (this.orientation == PlotOrientation.VERTICAL) { space.ensureAtLeast(this.fixedDomainAxisSpace.getTop(), RectangleEdge.TOP); space.ensureAtLeast(this.fixedDomainAxisSpace.getBottom(), RectangleEdge.BOTTOM); } } else { // reserve space for the domain axes... for (int i = 0; i < this.domainAxes.size(); i++) { Axis axis = (Axis) this.domainAxes.get(i); if (axis != null) { RectangleEdge edge = getDomainAxisEdge(i); space = axis.reserveSpace(g2, this, plotArea, edge, space); } } }
if (this.fixedRangeAxisSpace != null) { if (this.orientation == PlotOrientation.HORIZONTAL) { space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(), RectangleEdge.TOP); space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(), RectangleEdge.BOTTOM); } else if (this.orientation == PlotOrientation.VERTICAL) { space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(), RectangleEdge.LEFT); space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(), RectangleEdge.RIGHT); } } else { // reserve space for the range axes... for (int i = 0; i < this.rangeAxes.size(); i++) { Axis axis = (Axis) this.rangeAxes.get(i); if (axis != null) { RectangleEdge edge = getRangeAxisEdge(i); space = axis.reserveSpace(g2, this, plotArea, edge, space); } } }
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: AxisSpace calculateDomainAxisSpace(Graphics2D, Rectangle2D, AxisSpace) Method name: AxisSpace calculateRangeAxisSpace(Graphics2D, Rectangle2D, AxisSpace)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (this.fixedDomainAxisSpace != null) {
1
if (this.fixedRangeAxisSpace != null) {
2
            if (this.orientation == PlotOrientation.HORIZONTAL) {
2
            if (this.orientation == PlotOrientation.HORIZONTAL) {
3
                space.ensureAtLeast(this.fixedDomainAxisSpace.getLeft(),
3
                space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(),
4
                        RectangleEdge.LEFT);
4
                        RectangleEdge.TOP);
5
                space.ensureAtLeast(this.fixedDomainAxisSpace.getRight(),
5
                space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(),
6
                        RectangleEdge.RIGHT);
6
                        RectangleEdge.BOTTOM);
7
            }
7
            }
8
            else if (this.orientation == PlotOrientation.VERTICAL) {
8
            else if (this.orientation == PlotOrientation.VERTICAL) {
9
                space.ensureAtLeast(this.fixedDomainAxisSpace.getTop(),
9
                space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(),
10
                        RectangleEdge.TOP);
10
                        RectangleEdge.LEFT);
11
                space.ensureAtLeast(this.fixedDomainAxisSpace.getBottom(),
11
                space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(),
12
                        RectangleEdge.BOTTOM);
12
                        RectangleEdge.RIGHT);
13
            }
13
            }
14
        }
14
        }
15
        else {
15
        else {
16
            // reserve space for the domain axes...
16
            // reserve space for the range axes...
17
            for (int i = 0; i < this.domainAxes.size(); i++) {
17
            for (int i = 0; i < this.rangeAxes.size(); i++) {
18
                Axis axis = (Axis) this.domainAxes.get(i);
18
                Axis axis = (Axis) this.rangeAxes.get(i);
19
                if (axis != null) {
19
                if (axis != null) {
20
                    RectangleEdge edge = getDomainAxisEdge(i);
20
                    RectangleEdge edge = getRangeAxisEdge(i);
21
                    space = axis.reserveSpace(g2, this, plotArea, edge, space);
21
                    space = axis.reserveSpace(g2, this, plotArea, edge, space);
22
                }
22
                }
23
            }
23
            }
24
        }
24
        }
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)1.4
Clones locationClones are declared in the same class
Number of node comparisons46
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (this.fixedDomainAxisSpace != null)
    3
    if (this.fixedDomainAxisSpace != null)
    3
    if (this.fixedRangeAxisSpace != null)
    Differences
    Expression1Expression2Difference
    fixedDomainAxisSpacefixedRangeAxisSpaceVARIABLE_NAME_MISMATCH
    3
    if (this.fixedRangeAxisSpace != null)
    4
    if (this.orientation == PlotOrientation.HORIZONTAL)
    4
    if (this.orientation == PlotOrientation.HORIZONTAL)
    7
    if (this.orientation == PlotOrientation.VERTICAL)
    Differences
    Expression1Expression2Difference
    HORIZONTALVERTICALVARIABLE_NAME_MISMATCH
    7
    if (this.orientation == PlotOrientation.VERTICAL)
    5
    space.ensureAtLeast(this.fixedDomainAxisSpace.getLeft(), RectangleEdge.LEFT);
    5
    space.ensureAtLeast(this.fixedDomainAxisSpace.getLeft(), RectangleEdge.LEFT);
    8
    space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(), RectangleEdge.LEFT);
    Differences
    Expression1Expression2Difference
    fixedDomainAxisSpacefixedRangeAxisSpaceVARIABLE_NAME_MISMATCH
    8
    space.ensureAtLeast(this.fixedRangeAxisSpace.getLeft(), RectangleEdge.LEFT);
    6
    space.ensureAtLeast(this.fixedDomainAxisSpace.getRight(), RectangleEdge.RIGHT);
    6
    space.ensureAtLeast(this.fixedDomainAxisSpace.getRight(), RectangleEdge.RIGHT);
    9
    space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(), RectangleEdge.RIGHT);
    Differences
    Expression1Expression2Difference
    fixedDomainAxisSpacefixedRangeAxisSpaceVARIABLE_NAME_MISMATCH
    9
    space.ensureAtLeast(this.fixedRangeAxisSpace.getRight(), RectangleEdge.RIGHT);
    7
    else if (this.orientation == PlotOrientation.VERTICAL)
    7
    else if (this.orientation == PlotOrientation.VERTICAL)
    4
    else if (this.orientation == PlotOrientation.HORIZONTAL)
    Differences
    Expression1Expression2Difference
    VERTICALHORIZONTALVARIABLE_NAME_MISMATCH
    4
    else if (this.orientation == PlotOrientation.HORIZONTAL)
    8
    space.ensureAtLeast(this.fixedDomainAxisSpace.getTop(), RectangleEdge.TOP);
    8
    space.ensureAtLeast(this.fixedDomainAxisSpace.getTop(), RectangleEdge.TOP);
    5
    space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(), RectangleEdge.TOP);
    Differences
    Expression1Expression2Difference
    fixedDomainAxisSpacefixedRangeAxisSpaceVARIABLE_NAME_MISMATCH
    5
    space.ensureAtLeast(this.fixedRangeAxisSpace.getTop(), RectangleEdge.TOP);
    9
    space.ensureAtLeast(this.fixedDomainAxisSpace.getBottom(), RectangleEdge.BOTTOM);
    9
    space.ensureAtLeast(this.fixedDomainAxisSpace.getBottom(), RectangleEdge.BOTTOM);
    6
    space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(), RectangleEdge.BOTTOM);
    Differences
    Expression1Expression2Difference
    fixedDomainAxisSpacefixedRangeAxisSpaceVARIABLE_NAME_MISMATCH
    6
    space.ensureAtLeast(this.fixedRangeAxisSpace.getBottom(), RectangleEdge.BOTTOM);
    else
    else
    10
    for (int i = 0; i < this.domainAxes.size(); i++)
    10
    for (int i = 0; i < this.domainAxes.size(); i++)
    10
    for (int i = 0; i < this.rangeAxes.size(); i++)
    Differences
    Expression1Expression2Difference
    domainAxesrangeAxesVARIABLE_NAME_MISMATCH
    10
    for (int i = 0; i < this.rangeAxes.size(); i++)
    11
    Axis axis = (Axis)this.domainAxes.get(i);
    11
    Axis axis = (Axis)this.domainAxes.get(i);
    11
    Axis axis = (Axis)this.rangeAxes.get(i);
    Differences
    Expression1Expression2Difference
    domainAxesrangeAxesVARIABLE_NAME_MISMATCH
    11
    Axis axis = (Axis)this.rangeAxes.get(i);
    12
    if (axis != null)
    12
    if (axis != null)
    13
    RectangleEdge edge = getDomainAxisEdge(i);
    13
    RectangleEdge edge = getDomainAxisEdge(i);
    13
    RectangleEdge edge = getRangeAxisEdge(i);
    Differences
    Expression1Expression2Difference
    getDomainAxisEdgegetRangeAxisEdgeMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getDomainAxisEdge(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getRangeAxisEdge(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13
    RectangleEdge edge = getRangeAxisEdge(i);
    14
    space = axis.reserveSpace(g2, this, plotArea, edge, space);
    14
    space = axis.reserveSpace(g2, this, plotArea, edge, space);
    Precondition Violations (2)
    Row Violation
    1Expression getDomainAxisEdge(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getRangeAxisEdge(i) cannot be parameterized, because it has dependencies to/from statements that will be extracted