if (obj == this) { return true; } if (!(obj instanceof MultipleXYSeriesLabelGenerator)) { return false; } MultipleXYSeriesLabelGenerator that = (MultipleXYSeriesLabelGenerator) obj; if (!this.formatPattern.equals(that.formatPattern)) { return false; } if (!this.additionalFormatPattern.equals( that.additionalFormatPattern)) { return false; } if (!this.seriesLabelLists.equals(that.seriesLabelLists)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof SimpleHistogramDataset)) { return false; } SimpleHistogramDataset that = (SimpleHistogramDataset) obj; if (!this.key.equals(that.key)) { return false; } if (this.adjustForBinSize != that.adjustForBinSize) { return false; } if (!this.bins.equals(that.bins)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/MultipleXYSeriesLabelGenerator.java File path: /jfreechart-1.0.10/src/org/jfree/data/statistics/SimpleHistogramDataset.java
Method name: boolean equals(Object) Method name: boolean equals(Object)
Number of AST nodes: 12 Number of AST nodes: 12
1
if (obj == this) {
1
if (obj == this) {
2
            return true;
2
            return true;
3
        }
3
        }
4
        if (!(obj instanceof MultipleXYSeriesLabelGenerator)) {
4
        if (!(obj instanceof SimpleHistogramDataset)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        MultipleXYSeriesLabelGenerator that 
7
        
8
                = (MultipleXYSeriesLabelGenerator) obj;
8
SimpleHistogramDataset that = (SimpleHistogramDataset) obj;
9
        if (!this.formatPattern.equals(that.formatPattern)) {
9
        if (!this.key.equals(that.key)) {
10
            return false;
10
            return false;
11
        }
11
        }
12
        if (!this.additionalFormatPattern.equals(
12
        if (this.ad
13
                that.additionalFormatPattern)) {
13
justForBinSize != that.adjustForBinSize) {
14
            return false;
14
            return false;
15
        }
15
        }
16
        if (!this.seriesLabelLists.equals(that.seriesLabelLists)) {
16
        if (!this.bins.equals(that.bins)) {
17
            return false;
17
            return false;
18
        }
18
        }
19
        return true;
19
        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)3.2
Clones locationClones are in different classes
Number of node comparisons47
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)4.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (obj == this)
    1
    if (obj == this)
    2
    return true;
    2
    return true;
    3
    if (!(obj instanceof MultipleXYSeriesLabelGenerator))
    3
    if (!(obj instanceof MultipleXYSeriesLabelGenerator))
    3
    if (!(obj instanceof SimpleHistogramDataset))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.MultipleXYSeriesLabelGeneratororg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof SimpleHistogramDataset))
    4
    return false;
    4
    return false;
    5
    MultipleXYSeriesLabelGenerator that = (MultipleXYSeriesLabelGenerator)obj;
    5
    MultipleXYSeriesLabelGenerator that = (MultipleXYSeriesLabelGenerator)obj;
    5
    SimpleHistogramDataset that = (SimpleHistogramDataset)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.MultipleXYSeriesLabelGeneratororg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.MultipleXYSeriesLabelGeneratororg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.labels.MultipleXYSeriesLabelGeneratororg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    5
    SimpleHistogramDataset that = (SimpleHistogramDataset)obj;
    6
    if (!this.formatPattern.equals(that.formatPattern))
    6
    if (!this.formatPattern.equals(that.formatPattern))
    6
    if (!this.key.equals(that.key))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.MultipleXYSeriesLabelGeneratororg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    formatPatternkeyVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.lang.ComparableVARIABLE_TYPE_MISMATCH
    formatPatternkeyVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.lang.ComparableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.formatPattern cannot be unified with expression that.key , because common superclass type java.lang.Comparable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression that.formatPattern cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable that.formatPattern does not match with type java.lang.Comparable of variable that.key
    • Make classes java.lang.String and java.lang.Comparable extend a common superclass
    Type java.lang.String of variable this.formatPattern does not match with type java.lang.Comparable of variable this.key
    • Make classes java.lang.String and java.lang.Comparable extend a common superclass
    6
    if (!this.key.equals(that.key))
    7
    return false;
    7
    return false;
                                                                                                              
    8
    if (this.adjustForBinSize != that.adjustForBinSize)
    Preondition Violations
    Unmatched statement if(this.adjustForBinSize != that.adjustForBinSize) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    if (this.adjustForBinSize != that.adjustForBinSize)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
    8
    if (!this.additionalFormatPattern.equals(that.additionalFormatPattern))
    8
    if (!this.additionalFormatPattern.equals(that.additionalFormatPattern))
    10
    if (!this.bins.equals(that.bins))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.MultipleXYSeriesLabelGeneratororg.jfree.data.statistics.SimpleHistogramDatasetSUBCLASS_TYPE_MISMATCH
    additionalFormatPatternbinsVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.util.ListVARIABLE_TYPE_MISMATCH
    additionalFormatPatternbinsVARIABLE_NAME_MISMATCH
    java.lang.Stringjava.util.ListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression that.additionalFormatPattern cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.bins cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.lang.String of variable that.additionalFormatPattern does not match with type java.util.List of variable that.bins
    • Make classes java.lang.String and java.util.List extend a common superclass
    Type java.lang.String of variable this.additionalFormatPattern does not match with type java.util.List of variable this.bins
    • Make classes java.lang.String and java.util.List extend a common superclass
    10
    if (!this.bins.equals(that.bins))
    9
    return false;
    11
    return false;
    Precondition Violations (14)
    Row Violation
    1Expression that.formatPattern cannot be unified with expression that.key , because common superclass type java.lang.Comparable cannot be passed as an argument to public boolean equals(java.lang.Object)
    2Expression that.formatPattern cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type java.lang.String of variable that.formatPattern does not match with type java.lang.Comparable of variable that.key
    5Type java.lang.String of variable this.formatPattern does not match with type java.lang.Comparable of variable this.key
    6Unmatched statement if(this.adjustForBinSize != that.adjustForBinSize) cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7Unmatched return false;
    8Expression that.additionalFormatPattern cannot be parameterized, because it has dependencies to/from statements that will be extracted
    9Expression that.bins cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Type java.lang.String of variable that.additionalFormatPattern does not match with type java.util.List of variable that.bins
    11Type java.lang.String of variable this.additionalFormatPattern does not match with type java.util.List of variable this.bins
    12Clone fragment #1 returns variable that with type org.jfree.chart.labels.MultipleXYSeriesLabelGenerator , while Clone fragment #2 returns variable that with type org.jfree.data.statistics.SimpleHistogramDataset
    13Not all possible execution flows end in a return statement
    14The refactoring of the clones is infeasible, because classes org.jfree.chart.labels.MultipleXYSeriesLabelGenerator and org.jfree.data.statistics.SimpleHistogramDataset do not have a common superclass