if (r == null) { return null; } double lowerBound = 0.0; double upperBound = Double.POSITIVE_INFINITY; if (r.getLowerBound() > 0.0) { lowerBound = trimToContentWidth(r.getLowerBound()); } if (r.getUpperBound() < Double.POSITIVE_INFINITY) { upperBound = trimToContentWidth(r.getUpperBound()); } return new Range(lowerBound, upperBound);
if (r == null) { return null; } double lowerBound = 0.0; double upperBound = Double.POSITIVE_INFINITY; if (r.getLowerBound() > 0.0) { lowerBound = trimToContentHeight(r.getLowerBound()); } if (r.getUpperBound() < Double.POSITIVE_INFINITY) { upperBound = trimToContentHeight(r.getUpperBound()); } return new Range(lowerBound, upperBound);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/AbstractBlock.java File path: /jfreechart-1.0.10/src/org/jfree/chart/block/AbstractBlock.java
Method name: Range trimToContentWidth(Range) Method name: Range trimToContentHeight(Range)
Number of AST nodes: 9 Number of AST nodes: 9
1
if (r == null) {
1
if (r == null) {
2
            return null;   
2
            return null;   
3
        }
3
        }
4
        double lowerBound = 0.0;
4
        double lowerBound = 0.0;
5
        double upperBound = Double.POSITIVE_INFINITY;
5
        double upperBound = Double.POSITIVE_INFINITY;
6
        if (r.getLowerBound() > 0.0) {
6
        if (r.getLowerBound() > 0.0) {
7
            lowerBound = trimToContentWidth(r.getLowerBound());   
7
            lowerBound = trimToContentHeight(r.getLowerBound());   
8
        }
8
        }
9
        if (r.getUpperBound() < Double.POSITIVE_INFINITY) {
9
        if (r.getUpperBound() < Double.POSITIVE_INFINITY) {
10
            upperBound = trimToContentWidth(r.getUpperBound());
10
            upperBound = trimToContentHeight(r.getUpperBound());
11
        }
11
        }
12
        return new Range(lowerBound, upperBound);
12
        return new Range(lowerBound, upperBound);
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 declared in the same class
Number of node comparisons27
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    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.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (r == null)
    1
    if (r == null)
    2
    return null;
    2
    return null;
    3
    double lowerBound = 0.0;
    3
    double lowerBound = 0.0;
    4
    double upperBound = Double.POSITIVE_INFINITY;
    4
    double upperBound = Double.POSITIVE_INFINITY;
    5
    if (r.getLowerBound() > 0.0)
    5
    if (r.getLowerBound() > 0.0)
    6
    lowerBound = trimToContentWidth(r.getLowerBound());
    6
    lowerBound = trimToContentWidth(r.getLowerBound());
    6
    lowerBound = trimToContentHeight(r.getLowerBound());
    Differences
    Expression1Expression2Difference
    trimToContentWidthtrimToContentHeightMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression trimToContentWidth(r.getLowerBound()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression trimToContentHeight(r.getLowerBound()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    lowerBound = trimToContentHeight(r.getLowerBound());
    7
    if (r.getUpperBound() < Double.POSITIVE_INFINITY)
    7
    if (r.getUpperBound() < Double.POSITIVE_INFINITY)
    8
    upperBound = trimToContentWidth(r.getUpperBound());
    8
    upperBound = trimToContentWidth(r.getUpperBound());
    8
    upperBound = trimToContentHeight(r.getUpperBound());
    Differences
    Expression1Expression2Difference
    trimToContentWidthtrimToContentHeightMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression trimToContentWidth(r.getUpperBound()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression trimToContentHeight(r.getUpperBound()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8
    upperBound = trimToContentHeight(r.getUpperBound());
    9
    return new Range(lowerBound, upperBound);
    9
    return new Range(lowerBound, upperBound);
    Precondition Violations (4)
    Row Violation
    1Expression trimToContentWidth(r.getLowerBound()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression trimToContentHeight(r.getLowerBound()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression trimToContentWidth(r.getUpperBound()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression trimToContentHeight(r.getUpperBound()) cannot be parameterized, because it has dependencies to/from statements that will be extracted