if (obj == this) { return true; } if (!(obj instanceof AbstractPieItemLabelGenerator)) { return false; } AbstractPieItemLabelGenerator that = (AbstractPieItemLabelGenerator) obj; if (!this.labelFormat.equals(that.labelFormat)) { return false; } if (!this.numberFormat.equals(that.numberFormat)) { return false; } if (!this.percentFormat.equals(that.percentFormat)) { return false; } return true;
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;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/AbstractPieItemLabelGenerator.java File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/MultipleXYSeriesLabelGenerator.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 AbstractPieItemLabelGenerator)) {
4
        if (!(obj instanceof MultipleXYSeriesLabelGenerator)) {
5
            return false;
5
            return false;
6
        }
6
        }
7
        AbstractPieItemLabelGenerator that
7
        MultipleXYSeriesLabelGenerator that 
8
                = (AbstractPieItemLabelGenerator) obj;
8
                = (MultipleXYSeriesLabelGenerator) obj;
9
        if (!this.labelFormat.equals(that.labelFormat)) {
9
        if (!this.formatPattern.equals(that.formatPattern)) {
10
            return false;
10
            return false;
11
        }
11
        }
12
        if (!this.numberFormat.equals(that.numberFormat
12
        if (!this.additionalFormatPattern.equals(
13
)) {
13
                that.additionalFormatPattern)) {
14
            return false;
14
            return false;
15
        }
15
        }
16
        if (!this.percentFormat.equals(that.percentFormat)) {
16
        if (!this.seriesLabelLists.equals(that.seriesLabelLists)) {
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)2.3
Clones locationClones are in different classes
Number of node comparisons62
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements11
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)2.8
    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 AbstractPieItemLabelGenerator))
    3
    if (!(obj instanceof AbstractPieItemLabelGenerator))
    3
    if (!(obj instanceof MultipleXYSeriesLabelGenerator))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractPieItemLabelGeneratororg.jfree.chart.labels.MultipleXYSeriesLabelGeneratorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.labels.AbstractPieItemLabelGenerator does not match with type org.jfree.chart.labels.MultipleXYSeriesLabelGenerator
    • Make classes org.jfree.chart.labels.AbstractPieItemLabelGenerator and org.jfree.chart.labels.MultipleXYSeriesLabelGenerator extend a common superclass
    3
    if (!(obj instanceof MultipleXYSeriesLabelGenerator))
    4
    return false;
    4
    return false;
                                                                                                                                                          
    5
    MultipleXYSeriesLabelGenerator that = (MultipleXYSeriesLabelGenerator)obj;
    5
    AbstractPieItemLabelGenerator that = (AbstractPieItemLabelGenerator)obj;
                                                                                                                                                      
    6
    if (!this.labelFormat.equals(that.labelFormat))
    6
    if (!this.labelFormat.equals(that.labelFormat))
    6
    if (!this.formatPattern.equals(that.formatPattern))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractPieItemLabelGeneratororg.jfree.chart.labels.MultipleXYSeriesLabelGeneratorVARIABLE_TYPE_MISMATCH
    labelFormatformatPatternVARIABLE_NAME_MISMATCH
    labelFormatformatPatternVARIABLE_NAME_MISMATCH
    Preondition Violations
    Type java.lang.String of variable that.labelFormat does not match with type java.lang.String of variable that.formatPattern
    • Make classes org.jfree.chart.labels.AbstractPieItemLabelGenerator and org.jfree.chart.labels.MultipleXYSeriesLabelGenerator extend a common superclass
    Expression that.labelFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.formatPattern cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6
    if (!this.formatPattern.equals(that.formatPattern))
    7
    return false;
    7
    return false;
    8
    if (!this.numberFormat.equals(that.numberFormat))
    8
    if (!this.numberFormat.equals(that.numberFormat))
    8
    if (!this.additionalFormatPattern.equals(that.additionalFormatPattern))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractPieItemLabelGeneratororg.jfree.chart.labels.MultipleXYSeriesLabelGeneratorVARIABLE_TYPE_MISMATCH
    numberFormatadditionalFormatPatternVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.lang.StringVARIABLE_TYPE_MISMATCH
    numberFormatadditionalFormatPatternVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.lang.StringVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.text.NumberFormat of variable that.numberFormat does not match with type java.lang.String of variable that.additionalFormatPattern
    • Make classes org.jfree.chart.labels.AbstractPieItemLabelGenerator and org.jfree.chart.labels.MultipleXYSeriesLabelGenerator extend a common superclass
    Expression that.numberFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.additionalFormatPattern cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.text.NumberFormat of variable that.numberFormat does not match with type java.lang.String of variable that.additionalFormatPattern
    • Make classes java.text.NumberFormat and java.lang.String extend a common superclass
    Type java.text.NumberFormat of variable this.numberFormat does not match with type java.lang.String of variable this.additionalFormatPattern
    • Make classes java.text.NumberFormat and java.lang.String extend a common superclass
    8
    if (!this.additionalFormatPattern.equals(that.additionalFormatPattern))
    9
    return false;
    9
    return false;
    10
    if (!this.percentFormat.equals(that.percentFormat))
    10
    if (!this.percentFormat.equals(that.percentFormat))
    10
    if (!this.seriesLabelLists.equals(that.seriesLabelLists))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.labels.AbstractPieItemLabelGeneratororg.jfree.chart.labels.MultipleXYSeriesLabelGeneratorVARIABLE_TYPE_MISMATCH
    percentFormatseriesLabelListsVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.util.MapVARIABLE_TYPE_MISMATCH
    percentFormatseriesLabelListsVARIABLE_NAME_MISMATCH
    java.text.NumberFormatjava.util.MapVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.text.NumberFormat of variable that.percentFormat does not match with type java.util.Map of variable that.seriesLabelLists
    • Make classes org.jfree.chart.labels.AbstractPieItemLabelGenerator and org.jfree.chart.labels.MultipleXYSeriesLabelGenerator extend a common superclass
    Expression that.percentFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.seriesLabelLists cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type java.text.NumberFormat of variable that.percentFormat does not match with type java.util.Map of variable that.seriesLabelLists
    • Make classes java.text.NumberFormat and java.util.Map extend a common superclass
    Type java.text.NumberFormat of variable this.percentFormat does not match with type java.util.Map of variable this.seriesLabelLists
    • Make classes java.text.NumberFormat and java.util.Map extend a common superclass
    10
    if (!this.seriesLabelLists.equals(that.seriesLabelLists))
    11
    return false;
    11
    return false;
    12
    return true;
    12
    return true;
    Precondition Violations (14)
    Row Violation
    1Type org.jfree.chart.labels.AbstractPieItemLabelGenerator does not match with type org.jfree.chart.labels.MultipleXYSeriesLabelGenerator
    2Type java.lang.String of variable that.labelFormat does not match with type java.lang.String of variable that.formatPattern
    3Expression that.labelFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression that.formatPattern cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Type java.text.NumberFormat of variable that.numberFormat does not match with type java.lang.String of variable that.additionalFormatPattern
    6Expression that.numberFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.additionalFormatPattern cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.text.NumberFormat of variable that.numberFormat does not match with type java.lang.String of variable that.additionalFormatPattern
    9Type java.text.NumberFormat of variable this.numberFormat does not match with type java.lang.String of variable this.additionalFormatPattern
    10Type java.text.NumberFormat of variable that.percentFormat does not match with type java.util.Map of variable that.seriesLabelLists
    11Expression that.percentFormat cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression that.seriesLabelLists cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Type java.text.NumberFormat of variable that.percentFormat does not match with type java.util.Map of variable that.seriesLabelLists
    14Type java.text.NumberFormat of variable this.percentFormat does not match with type java.util.Map of variable this.seriesLabelLists