if (drawHeight < this.minimumDrawHeight) { this.scaleY = drawHeight / this.minimumDrawHeight; drawHeight = this.minimumDrawHeight; scale = true; } else if (drawHeight > this.maximumDrawHeight) { this.scaleY = drawHeight / this.maximumDrawHeight; drawHeight = this.maximumDrawHeight; scale = true; }
if (drawHeight < this.minimumDrawHeight) { this.scaleY = (double) drawHeight / this.minimumDrawHeight; drawHeight = this.minimumDrawHeight; scale = true; } else if (drawHeight > this.maximumDrawHeight) { this.scaleY = (double) drawHeight / this.maximumDrawHeight; drawHeight = this.maximumDrawHeight; scale = true; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartPanel.java File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/ChartComposite.java
Method name: void paintComponent(Graphics) Method name: void paintControl(PaintEvent)
Number of AST nodes: 8 Number of AST nodes: 8
1
if (drawHeight < this.minimumDrawHeight) {
1
if (drawHeight < this.minimumDrawHeight) {
2
            this.scaleY = drawHeight / this.minimumDrawHeight;
2
            this.scaleY = (double) drawHeight / this.minimumDrawHeight;
3
            drawHeight = this.minimumDrawHeight;
3
            drawHeight = this.minimumDrawHeight;
4
            scale = true;
4
            scale = true;
5
        }
5
        }
6
        else if (drawHeight > this.maximumDrawHeight) {
6
        else if (drawHeight > this.maximumDrawHeight) {
7
            this.scaleY = drawHeight / this.maximumDrawHeight;
7
            this.scaleY = (double) drawHeight / this.maximumDrawHeight;
8
            drawHeight = this.maximumDrawHeight;
8
            drawHeight = this.maximumDrawHeight;
9
            scale = true;
9
            scale = true;
10
        }
10
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)1.4
Clones locationClones are in different classes
Number of node comparisons49
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)9.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    21
    if (drawHeight < this.minimumDrawHeight)
    21
    if (drawHeight < this.minimumDrawHeight)
    21
    if (drawHeight < this.minimumDrawHeight)
    Differences
    Expression1Expression2Difference
    doubleintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable drawHeight does not match with type int of variable drawHeight
    21
    if (drawHeight < this.minimumDrawHeight)
    22
    this.scaleY = drawHeight / this.minimumDrawHeight;
    22
    this.scaleY = drawHeight / this.minimumDrawHeight;
    22
    this.scaleY = (double)drawHeight / this.minimumDrawHeight;
    Differences
    Expression1Expression2Difference
    drawHeight(double)drawHeightTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression (double)drawHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22
    this.scaleY = (double)drawHeight / this.minimumDrawHeight;
                                                                                
    23
    drawHeight = this.minimumDrawHeight;
    Preondition Violations
    Unmatched statement drawHeight=this.minimumDrawHeight; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    23
    drawHeight = this.minimumDrawHeight;
    23
    drawHeight = this.minimumDrawHeight;
    23
    drawHeight = this.minimumDrawHeight;
    Preondition Violations
    Unmatched statement drawHeight=this.minimumDrawHeight; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
    24
    scale = true;
    24
    scale = true;
    25
    else if (drawHeight > this.maximumDrawHeight)
    25
    else if (drawHeight > this.maximumDrawHeight)
    25
    else if (drawHeight > this.maximumDrawHeight)
    Differences
    Expression1Expression2Difference
    doubleintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable drawHeight does not match with type int of variable drawHeight
    25
    else if (drawHeight > this.maximumDrawHeight)
    26
    this.scaleY = drawHeight / this.maximumDrawHeight;
    26
    this.scaleY = drawHeight / this.maximumDrawHeight;
    26
    this.scaleY = (double)drawHeight / this.maximumDrawHeight;
    Differences
    Expression1Expression2Difference
    drawHeight(double)drawHeightTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression (double)drawHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26
    this.scaleY = (double)drawHeight / this.maximumDrawHeight;
                                                                                
    27
    drawHeight = this.maximumDrawHeight;
    Preondition Violations
    Unmatched statement drawHeight=this.maximumDrawHeight; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    27
    drawHeight = this.maximumDrawHeight;
    27
    drawHeight = this.maximumDrawHeight;
    27
    drawHeight = this.maximumDrawHeight;
    Preondition Violations
    Unmatched statement drawHeight=this.maximumDrawHeight; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                
    28
    scale = true;
    28
    scale = true;
    Precondition Violations (9)
    Row Violation
    1Type double of variable drawHeight does not match with type int of variable drawHeight
    2Expression (double)drawHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Unmatched statement drawHeight=this.minimumDrawHeight; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4Unmatched statement drawHeight=this.minimumDrawHeight; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5Type double of variable drawHeight does not match with type int of variable drawHeight
    6Expression (double)drawHeight cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Unmatched statement drawHeight=this.maximumDrawHeight; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement drawHeight=this.maximumDrawHeight; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9The refactoring of the clones is infeasible, because classes org.jfree.chart.ChartPanel and org.jfree.experimental.chart.swt.ChartComposite do not have a common superclass