if (range == null) { throw new IllegalArgumentException("Null 'range' argument."); } return new RectangleConstraint(range.getUpperBound(), range, LengthConstraintType.RANGE, this.height, this.heightRange, this.heightConstraintType);
if (range == null) { throw new IllegalArgumentException("Null 'range' argument."); } return new RectangleConstraint(this.width, this.widthRange, this.widthConstraintType, range.getUpperBound(), range, LengthConstraintType.RANGE);
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/block/RectangleConstraint.java File path: /jfreechart-1.0.10/src/org/jfree/chart/block/RectangleConstraint.java
Method name: RectangleConstraint toRangeWidth(Range) Method name: RectangleConstraint toRangeHeight(Range)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (range == null) {
1
if (range == null) {
2
            throw new IllegalArgumentException("Null 'range' argument.");   
2
            throw new IllegalArgumentException("Null 'range' argument.");   
3
        }
3
        }
4
        return new RectangleConstraint(range.getUpperBound(), range, 
4
        return new RectangleConstraint(this.width, this.widthRange, 
5
                LengthConstraintType.RANGE, this.height, this.heightRange, 
5
                this.widthConstraintType, range.getUpperBound(), range, 
6
                this.heightConstraintType);
6
                LengthConstraintType.RANGE);
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 comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (range == null)
    1
    if (range == null)
    2
    throw new IllegalArgumentException("Null 'range' argument.");
    2
    throw new IllegalArgumentException("Null 'range' argument.");
    3
    return new RectangleConstraint(range.getUpperBound(), range, LengthConstraintType.RANGE, this.height, this.heightRange, this.heightConstraintType);
    3
    return new RectangleConstraint(range.getUpperBound(), range, LengthConstraintType.RANGE, this.height, this.heightRange, this.heightConstraintType);
    3
    return new RectangleConstraint(this.width, this.widthRange, this.widthConstraintType, range.getUpperBound(), range, LengthConstraintType.RANGE);
    Differences
    Expression1Expression2Difference
    range.getUpperBound()this.widthTYPE_COMPATIBLE_REPLACEMENT
    rangethis.widthRangeTYPE_COMPATIBLE_REPLACEMENT
    LengthConstraintType.RANGEthis.widthConstraintTypeTYPE_COMPATIBLE_REPLACEMENT
    this.heightrange.getUpperBound()TYPE_COMPATIBLE_REPLACEMENT
    this.heightRangerangeTYPE_COMPATIBLE_REPLACEMENT
    this.heightConstraintTypeLengthConstraintType.RANGETYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression range.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression range.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    return new RectangleConstraint(this.width, this.widthRange, this.widthConstraintType, range.getUpperBound(), range, LengthConstraintType.RANGE);
    Precondition Violations (2)
    Row Violation
    1Expression range.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression range.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted