double result = this.margin.trimWidth(fixedWidth); result = this.frame.getInsets().trimWidth(result); result = this.padding.trimWidth(result); return Math.max(result, 0.0);
double result = this.margin.trimHeight(fixedHeight); result = this.frame.getInsets().trimHeight(result); result = this.padding.trimHeight(result); return Math.max(result, 0.0);
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: double trimToContentWidth(double) Method name: double trimToContentHeight(double)
Number of AST nodes: 4 Number of AST nodes: 4
1
double result = this.margin.trimWidth(fixedWidth);
1
double result = this.margin.trimHeight(fixedHeight);
2
        result = this.frame.getInsets().trimWidth(result);
2
        result = this.frame.getInsets().trimHeight(result);
3
        result = this.padding.trimWidth(result);
3
        result = this.padding.trimHeight(result);
4
        return Math.max(result, 0.0);
4
        return Math.max(result, 0.0);
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.0
Clones locationClones are declared in the same class
Number of node comparisons16
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    double result = this.margin.trimWidth(fixedWidth);
    1
    double result = this.margin.trimWidth(fixedWidth);
    1
    double result = this.margin.trimHeight(fixedHeight);
    Differences
    Expression1Expression2Difference
    fixedWidthfixedHeightVARIABLE_NAME_MISMATCH
    trimWidthtrimHeightMETHOD_INVOCATION_NAME_MISMATCH
    1
    double result = this.margin.trimHeight(fixedHeight);
    2
    result = this.frame.getInsets().trimWidth(result);
    2
    result = this.frame.getInsets().trimWidth(result);
    2
    result = this.frame.getInsets().trimHeight(result);
    Differences
    Expression1Expression2Difference
    trimWidthtrimHeightMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.frame.getInsets().trimWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.frame.getInsets().trimHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    result = this.frame.getInsets().trimHeight(result);
    3
    result = this.padding.trimWidth(result);
    3
    result = this.padding.trimWidth(result);
    3
    result = this.padding.trimHeight(result);
    Differences
    Expression1Expression2Difference
    trimWidthtrimHeightMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.padding.trimWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.padding.trimHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    result = this.padding.trimHeight(result);
    4
    return Math.max(result, 0.0);
    4
    return Math.max(result, 0.0);
    Precondition Violations (4)
    Row Violation
    1Expression this.frame.getInsets().trimWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.frame.getInsets().trimHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression this.padding.trimWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.padding.trimHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted