if (obj == this) { return true; } if (!(obj instanceof AbstractBlock)) { return false; } AbstractBlock that = (AbstractBlock) obj; if (!ObjectUtilities.equal(this.id, that.id)) { return false; } if (!this.frame.equals(that.frame)) { return false; } if (!this.bounds.equals(that.bounds)) { return false; } if (!this.margin.equals(that.margin)) { return false; } if (!this.padding.equals(that.padding)) { return false; } if (this.height != that.height) { return false; } if (this.width != that.width) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof AbstractXYItemLabelGenerator)) { return false; } AbstractXYItemLabelGenerator that = (AbstractXYItemLabelGenerator) obj; if (!this.formatString.equals(that.formatString)) { return false; } if (!ObjectUtilities.equal(this.xFormat, that.xFormat)) { return false; } if (!ObjectUtilities.equal(this.xDateFormat, that.xDateFormat)) { return false; } if (!ObjectUtilities.equal(this.yFormat, that.yFormat)) { return false; } if (!ObjectUtilities.equal(this.yDateFormat, that.yDateFormat)) { return false; } if (!this.nullYString.equals(that.nullYString)) { return false; } return true;
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/labels/AbstractXYItemLabelGenerator.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 20 Number of AST nodes: 18
1
if (obj == this) {
1
if (obj == this) {
2
            return true;   
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof AbstractBlock)) {
4
        if (!(obj instanceof AbstractXYItemLabelGenerator)) {
5
            return false;   
5
            return false;
6
        }
6
        }
7
        AbstractBlock that = (AbstractBlock) obj;
7
        AbstractXYItemLabelGenerator that = (AbstractXYItemLabelGenerator) obj;
8
        if (!ObjectUtilities.equal(this.id, that.id)) {
8
        if (!this.formatString.equals(that.formatString)) {
9
            return false;
9
            return false;
10
        }
10
        }
11
        if (!this.frame.equals(that.frame)) {
11
        if (!ObjectUtilities.equal(this.xFormat, that.xFormat)) {
12
            return false;   
12
            return false;
13
        }
13
        }
14
        if (!this.bounds.equals(that.bounds)) {
14
        if (!ObjectUtilities.equal(this.xDateFormat, that.xDateFormat)) {
15
            return false;   
15
            return false;
16
        }
16
        }
17
        if (!this.margin.equals(that.margin)) {
17
        if (!ObjectUtilities.equal(this.yFormat, that.yFormat)) {
18
            return false;   
18
            return false;
19
        }
19
        }
20
        if (!this.padding.equals(that.padding)) {
20
        if (!ObjectUtilities.equal(th
21
            return false;   
22
        }
23
        if (this.height != that.height) {
21
is.yDateFormat, that.yDateFormat)) {
24
            return false;   
22
            return false;
25
        }
23
        }
26
        if (this.width != that.width) {
24
        if (!this.nullYString.equals(that.nullYString)) {
27
            return false;   
25
        	return false;
28
        }
26
        }
29
        return true;
27
        return true;
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)8.8
Clones locationClones are in different classes
Number of node comparisons139
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements14
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof AbstractBlock))
    3
    if (!(obj instanceof AbstractBlock))
    3
    if (!(obj instanceof AbstractXYItemLabelGenerator))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.AbstractBlockorg.jfree.chart.labels.AbstractXYItemLabelGeneratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.AbstractBlock does not match with type org.jfree.chart.labels.AbstractXYItemLabelGenerator
    • Make classes org.jfree.chart.block.AbstractBlock and org.jfree.chart.labels.AbstractXYItemLabelGenerator extend a common superclass
    3
    if (!(obj instanceof AbstractXYItemLabelGenerator))
    4
    return false;
    4
    return false;
                                                                                                                                                  
    5
    AbstractXYItemLabelGenerator that = (AbstractXYItemLabelGenerator)obj;
    5
    AbstractBlock that = (AbstractBlock)obj;
                                                                                      
    6
    if (!ObjectUtilities.equal(this.id, that.id))
    6
    if (!ObjectUtilities.equal(this.id, that.id))
    8
    if (!ObjectUtilities.equal(this.xFormat, that.xFormat))
    Differences
    Expression1Expression2Difference
    idxFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.NumberFormatVARIABLE_TYPE_MISMATCH
    org.jfree.chart.block.AbstractBlockorg.jfree.chart.labels.AbstractXYItemLabelGeneratorVARIABLE_TYPE_MISMATCH
    idxFormatVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.text.NumberFormatVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.String of variable this.id does not match with type java.text.NumberFormat of variable this.xFormat
    • Make classes java.lang.String and java.text.NumberFormat extend a common superclass
    Type java.lang.String of variable that.id does not match with type java.text.NumberFormat of variable that.xFormat
    • Make classes org.jfree.chart.block.AbstractBlock and org.jfree.chart.labels.AbstractXYItemLabelGenerator extend a common superclass
    Expression that.id cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.xFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable that.id does not match with type java.text.NumberFormat of variable that.xFormat
    • Make classes java.lang.String and java.text.NumberFormat extend a common superclass
    8
    if (!ObjectUtilities.equal(this.xFormat, that.xFormat))
    7
    return false;
    9
    return false;
    8
    if (!this.frame.equals(that.frame))
    8
    if (!this.frame.equals(that.frame))
    6
    if (!this.formatString.equals(that.formatString))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.AbstractBlockorg.jfree.chart.labels.AbstractXYItemLabelGeneratorVARIABLE_TYPE_MISMATCH
    frameformatStringVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.BlockFramejava.lang.StringVARIABLE_TYPE_MISMATCH
    frameformatStringVARIABLE_NAME_MISMATCH
    org.jfree.chart.block.BlockFramejava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.BlockFrame of variable that.frame does not match with type java.lang.String of variable that.formatString
    • Make classes org.jfree.chart.block.AbstractBlock and org.jfree.chart.labels.AbstractXYItemLabelGenerator extend a common superclass
    Expression that.frame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.formatString cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.chart.block.BlockFrame of variable that.frame does not match with type java.lang.String of variable that.formatString
    • Make classes org.jfree.chart.block.BlockFrame and java.lang.String extend a common superclass
    Type org.jfree.chart.block.BlockFrame of variable this.frame does not match with type java.lang.String of variable this.formatString
    • Make classes org.jfree.chart.block.BlockFrame and java.lang.String extend a common superclass
    6
    if (!this.formatString.equals(that.formatString))
    9
    return false;
    7
    return false;
    10
    if (!this.bounds.equals(that.bounds))
    10
    if (!this.bounds.equals(that.bounds))
    10
    if (!ObjectUtilities.equal(this.xDateFormat, that.xDateFormat))
    Differences
    Expression1Expression2Difference
    this.bounds.equals(that.bounds)ObjectUtilities.equal(this.xDateFormat,that.xDateFormat)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.bounds.equals(that.bounds) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.xDateFormat,that.xDateFormat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!ObjectUtilities.equal(this.xDateFormat, that.xDateFormat))
    11
    return false;
    11
    return false;
    12
    if (!this.margin.equals(that.margin))
    12
    if (!this.margin.equals(that.margin))
    12
    if (!ObjectUtilities.equal(this.yFormat, that.yFormat))
    Differences
    Expression1Expression2Difference
    this.margin.equals(that.margin)ObjectUtilities.equal(this.yFormat,that.yFormat)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.margin.equals(that.margin) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.yFormat,that.yFormat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12
    if (!ObjectUtilities.equal(this.yFormat, that.yFormat))
    13
    return false;
    13
    return false;
    14
    if (!this.padding.equals(that.padding))
    14
    if (!this.padding.equals(that.padding))
    14
    if (!ObjectUtilities.equal(this.yDateFormat, that.yDateFormat))
    Differences
    Expression1Expression2Difference
    this.padding.equals(that.padding)ObjectUtilities.equal(this.yDateFormat,that.yDateFormat)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.padding.equals(that.padding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.yDateFormat,that.yDateFormat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14
    if (!ObjectUtilities.equal(this.yDateFormat, that.yDateFormat))
    15
    return false;
    15
    return false;
    Precondition Violations (18)
    Row Violation
    1Type org.jfree.chart.block.AbstractBlock does not match with type org.jfree.chart.labels.AbstractXYItemLabelGenerator
    2Type java.lang.String of variable this.id does not match with type java.text.NumberFormat of variable this.xFormat
    3Type java.lang.String of variable that.id does not match with type java.text.NumberFormat of variable that.xFormat
    4Expression that.id cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.xFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type java.lang.String of variable that.id does not match with type java.text.NumberFormat of variable that.xFormat
    7Type org.jfree.chart.block.BlockFrame of variable that.frame does not match with type java.lang.String of variable that.formatString
    8Expression that.frame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.formatString cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type org.jfree.chart.block.BlockFrame of variable that.frame does not match with type java.lang.String of variable that.formatString
    11Type org.jfree.chart.block.BlockFrame of variable this.frame does not match with type java.lang.String of variable this.formatString
    12Expression this.bounds.equals(that.bounds) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression ObjectUtilities.equal(this.xDateFormat,that.xDateFormat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression this.margin.equals(that.margin) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression ObjectUtilities.equal(this.yFormat,that.yFormat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression this.padding.equals(that.padding) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression ObjectUtilities.equal(this.yDateFormat,that.yDateFormat) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Not all possible execution flows end in a return statement