double result = contentWidth; result = this.padding.extendWidth(result); result = this.frame.getInsets().extendWidth(result); result = this.margin.extendWidth(result); return result;
double result = contentHeight; result = this.padding.extendHeight(result); result = this.frame.getInsets().extendHeight(result); result = this.margin.extendHeight(result); return result;
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 calculateTotalWidth(double) Method name: double calculateTotalHeight(double)
Number of AST nodes: 5 Number of AST nodes: 5
1
double result = contentWidth;
1
double result = contentHeight;
2
        result = this.padding.extendWidth(result);
2
        result = this.padding.extendHeight(result);
3
        result = this.frame.getInsets().extendWidth(result);
3
        result = this.frame.getInsets().extendHeight(result);
4
        result = this.margin.extendWidth(result);
4
        result = this.margin.extendHeight(result);
5
        return result;
5
        return result;
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 comparisons25
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements5
    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 = contentWidth;
    1
    double result = contentWidth;
    1
    double result = contentHeight;
    Differences
    Expression1Expression2Difference
    contentWidthcontentHeightVARIABLE_NAME_MISMATCH
    1
    double result = contentHeight;
    2
    result = this.padding.extendWidth(result);
    2
    result = this.padding.extendWidth(result);
    2
    result = this.padding.extendHeight(result);
    Differences
    Expression1Expression2Difference
    extendWidthextendHeightMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.padding.extendWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.padding.extendHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    result = this.padding.extendHeight(result);
    3
    result = this.frame.getInsets().extendWidth(result);
    3
    result = this.frame.getInsets().extendWidth(result);
    3
    result = this.frame.getInsets().extendHeight(result);
    Differences
    Expression1Expression2Difference
    extendWidthextendHeightMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.frame.getInsets().extendWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.frame.getInsets().extendHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    result = this.frame.getInsets().extendHeight(result);
    4
    result = this.margin.extendWidth(result);
    4
    result = this.margin.extendWidth(result);
    4
    result = this.margin.extendHeight(result);
    Differences
    Expression1Expression2Difference
    extendWidthextendHeightMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression this.margin.extendWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression this.margin.extendHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    result = this.margin.extendHeight(result);
    5
    return result;
    5
    return result;
    Precondition Violations (6)
    Row Violation
    1Expression this.padding.extendWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression this.padding.extendHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression this.frame.getInsets().extendWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression this.frame.getInsets().extendHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression this.margin.extendWidth(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression this.margin.extendHeight(result) cannot be parameterized, because it has dependencies to/from statements that will be extracted