if (this.widthConstraintType == LengthConstraintType.NONE) { return this; } else { return new RectangleConstraint(this.width, this.widthRange, LengthConstraintType.NONE, this.height, this.heightRange, this.heightConstraintType); }
if (this.heightConstraintType == LengthConstraintType.NONE) { return this; } else { return new RectangleConstraint(this.width, this.widthRange, this.widthConstraintType, 0.0, this.heightRange, LengthConstraintType.NONE); }
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 toUnconstrainedWidth() Method name: RectangleConstraint toUnconstrainedHeight()
Number of AST nodes: 3 Number of AST nodes: 3
1
if (this.widthConstraintType == LengthConstraintType.NONE) {
1
if (this.heightConstraintType == LengthConstraintType.NONE) {
2
            return this;   
2
            return this;   
3
        }
3
        }
4
        else {
4
        else {
5
            return new RectangleConstraint(this.width, this.widthRange, 
5
            return new RectangleConstraint(this.width, this.widthRange, 
6
                    LengthConstraintType.NONE, this.height, this.heightRange, 
6
                    this.widthConstraintType, 0.0, this.heightRange, 
7
                    this.heightConstraintType);
7
                    LengthConstraintType.NONE);
8
        }
8
        }
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.2
Clones locationClones are declared in the same class
Number of node comparisons9
  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)1.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (this.widthConstraintType == LengthConstraintType.NONE)
    1
    if (this.widthConstraintType == LengthConstraintType.NONE)
    1
    if (this.heightConstraintType == LengthConstraintType.NONE)
    Differences
    Expression1Expression2Difference
    widthConstraintTypeheightConstraintTypeVARIABLE_NAME_MISMATCH
    1
    if (this.heightConstraintType == LengthConstraintType.NONE)
    2
    return this;
    2
    return this;
    else
    else
    3
    return new RectangleConstraint(this.width, this.widthRange, LengthConstraintType.NONE, this.height, this.heightRange, this.heightConstraintType);
    3
    return new RectangleConstraint(this.width, this.widthRange, LengthConstraintType.NONE, this.height, this.heightRange, this.heightConstraintType);
    3
    return new RectangleConstraint(this.width, this.widthRange, this.widthConstraintType, 0.0, this.heightRange, LengthConstraintType.NONE);
    Differences
    Expression1Expression2Difference
    LengthConstraintType.NONEthis.widthConstraintTypeTYPE_COMPATIBLE_REPLACEMENT
    this.height0.0TYPE_COMPATIBLE_REPLACEMENT
    this.heightConstraintTypeLengthConstraintType.NONETYPE_COMPATIBLE_REPLACEMENT
    3
    return new RectangleConstraint(this.width, this.widthRange, this.widthConstraintType, 0.0, this.heightRange, LengthConstraintType.NONE);
    Precondition Violations (0)
    Row Violation