if (obj == this) { return true; } if (obj instanceof SubCategoryAxis && super.equals(obj)) { SubCategoryAxis axis = (SubCategoryAxis) obj; if (!this.subCategories.equals(axis.subCategories)) { return false; } if (!this.subLabelFont.equals(axis.subLabelFont)) { return false; } if (!this.subLabelPaint.equals(axis.subLabelPaint)) { return false; } return true; } return false;
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/axis/SubCategoryAxis.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 SubCategoryAxis && super.equals(obj)) {
4
        if (!(obj instanceof SimpleHistogramDataset)) {
5
            return false;
5
     
6
        }
6
       SubCategoryAxis axis = (SubCategoryAxis) obj;
7
        SimpleHistogramDataset that = (SimpleHistogramDataset) obj;
7
            if (!this.subCategories.equals(axis.subCategories)) {
8
        if (!this.key.equals(that.key)) {
8
                return false;
9
            return false;
9
            }
10
        }
10
            if (!this.subLabelFont.equals(axis.subLabelFont)) {
11
        if (this.adjustForBinSize != that.adjustForBinSize) {
11
                return false;   
12
            return false;
12
  
13
          }
13
        }
14
            if (!this.subLabelPaint.equals(axis.subLabelPaint)) {
14
        if (!this.bins.equals(that.bins)) {
15
                return false;   
15
            return false;
16
            }
16
        
17
    
17
}
18
        return true;
18
        return true;
19
        }
20
        return false;
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.5
Clones locationClones are in different classes
Number of node comparisons34
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)2.9
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    SubCategoryAxis axis = (SubCategoryAxis)obj;
                                                                                              
                                                                                                                          
    5
    SimpleHistogramDataset that = (SimpleHistogramDataset)obj;
    5
    if (!this.subCategories.equals(axis.subCategories))
    5
    if (!this.subCategories.equals(axis.subCategories))
    10
    if (!this.bins.equals(that.bins))
    Differences
    Expression1Expression2Difference
    axisthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.SubCategoryAxisorg.jfree.data.statistics.SimpleHistogramDatasetVARIABLE_TYPE_MISMATCH
    subCategoriesbinsVARIABLE_NAME_MISMATCH
    subCategoriesbinsVARIABLE_NAME_MISMATCH
    Preondition Violations
    Expression axis.subCategories 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.util.List of variable axis.subCategories does not match with type java.util.List of variable that.bins
    • Make classes org.jfree.chart.axis.SubCategoryAxis and org.jfree.data.statistics.SimpleHistogramDataset extend a common superclass
    Expression axis.subCategories 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
    10
    if (!this.bins.equals(that.bins))
    6
    return false;
    11
    return false;
    7
    if (!this.subLabelFont.equals(axis.subLabelFont))
    7
    if (!this.subLabelFont.equals(axis.subLabelFont))
    6
    if (!this.key.equals(that.key))
    Differences
    Expression1Expression2Difference
    axisthatVARIABLE_NAME_MISMATCH
    org.jfree.chart.axis.SubCategoryAxisorg.jfree.data.statistics.SimpleHistogramDatasetVARIABLE_TYPE_MISMATCH
    subLabelFontkeyVARIABLE_NAME_MISMATCH
    java.awt.Fontjava.lang.ComparableVARIABLE_TYPE_MISMATCH
    subLabelFontkeyVARIABLE_NAME_MISMATCH
    java.awt.Fontjava.lang.ComparableVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Expression axis.subLabelFont 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.awt.Font of variable axis.subLabelFont does not match with type java.lang.Comparable of variable that.key
    • Make classes org.jfree.chart.axis.SubCategoryAxis and org.jfree.data.statistics.SimpleHistogramDataset extend a common superclass
    Expression axis.subLabelFont 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.awt.Font of variable axis.subLabelFont does not match with type java.lang.Comparable of variable that.key
    • Make classes java.awt.Font and java.lang.Comparable extend a common superclass
    Type java.awt.Font of variable this.subLabelFont does not match with type java.lang.Comparable of variable this.key
    • Make classes java.awt.Font and java.lang.Comparable extend a common superclass
    6
    if (!this.key.equals(that.key))
    8
    return false;
    7
    return false;
    9
    if (!this.subLabelPaint.equals(axis.subLabelPaint))
    9
    if (!this.subLabelPaint.equals(axis.subLabelPaint))
    3
    if (!(obj instanceof SimpleHistogramDataset))
    Differences
    Expression1Expression2Difference
    this.subLabelPaint.equals(axis.subLabelPaint)(obj instanceof SimpleHistogramDataset)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.subLabelPaint.equals(axis.subLabelPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    if (!(obj instanceof SimpleHistogramDataset))
    10
    return false;
    4
    return false;
                                                                                                              
    8
    if (this.adjustForBinSize != that.adjustForBinSize)
                                    
    9
    return false;
    Preondition Violations
    Unmatched return false;
    9
    return false;
    Precondition Violations (15)
    Row Violation
    1Expression axis.subCategories cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression that.bins cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Type java.util.List of variable axis.subCategories does not match with type java.util.List of variable that.bins
    4Expression axis.subCategories cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.bins cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression axis.subLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type java.awt.Font of variable axis.subLabelFont does not match with type java.lang.Comparable of variable that.key
    9Expression axis.subLabelFont cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.key cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type java.awt.Font of variable axis.subLabelFont does not match with type java.lang.Comparable of variable that.key
    12Type java.awt.Font of variable this.subLabelFont does not match with type java.lang.Comparable of variable this.key
    13Expression this.subLabelPaint.equals(axis.subLabelPaint) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Unmatched return false;
    15Not all possible execution flows end in a return statement