if (obj == this) { return true; } if (!(obj instanceof ModuloAxis)) { return false; } ModuloAxis that = (ModuloAxis) obj; if (this.displayStart != that.displayStart) { return false; } if (this.displayEnd != that.displayEnd) { return false; } if (!this.fixedRange.equals(that.fixedRange)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof SlidingCategoryDataset)) { return false; } SlidingCategoryDataset that = (SlidingCategoryDataset) obj; if (this.firstCategoryIndex != that.firstCategoryIndex) { return false; } if (this.maximumCategoryCount != that.maximumCategoryCount) { return false; } if (!this.underlying.equals(that.underlying)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/ModuloAxis.java File path: /jfreechart-1.0.10/src/org/jfree/data/category/SlidingCategoryDataset.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
        }
4
        
3
		}
5
if (!(obj instanceof ModuloAxis)) {
4
		if (!(obj instanceof 
6
            return false;
7
        }
8
        ModuloAxis that = (ModuloAxis) obj;
9
        if (this.displayStart != that.displayStart) {
10
            return false;
11
        }
12
        if (this.displayEnd != that.displayEnd) {
13
            return false;
14
        }
15
        
5
SlidingCategoryDataset)) {
6
			return false;
7
		}
8
		SlidingCategoryDataset that = (SlidingCategoryDataset) obj;
9
		if (this.firstCategoryIndex != that.firstCategoryIndex) {
10
			return false;
11
		}
12
		if (this.maximumCategoryCount != that.maximumCategoryCount) {
13
			return false;
14
		}
16
if (!this.fixedRange.equals(that.fixedRange)) {
15
		if (!this.underlying.equals(that.underlying)) {
17
            return false;
16
			return false;
18
        }
19
        return super.equals(obj)
17
		}
20
;
18
		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.2
Clones locationClones are in different classes
Number of node comparisons50
  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)3.2
    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 ModuloAxis))
    3
    if (!(obj instanceof ModuloAxis))
    3
    if (!(obj instanceof SlidingCategoryDataset))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.ModuloAxisorg.jfree.data.category.SlidingCategoryDatasetVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.axis.ModuloAxis does not match with type org.jfree.data.category.SlidingCategoryDataset
    • Make classes org.jfree.chart.axis.ModuloAxis and org.jfree.data.category.SlidingCategoryDataset extend a common superclass
    3
    if (!(obj instanceof SlidingCategoryDataset))
    4
    return false;
    4
    return false;
                                                                                                                          
    5
    SlidingCategoryDataset that = (SlidingCategoryDataset)obj;
    5
    ModuloAxis that = (ModuloAxis)obj;
                                                                          
    6
    if (this.displayStart != that.displayStart)
    6
    if (this.displayStart != that.displayStart)
    6
    if (this.firstCategoryIndex != that.firstCategoryIndex)
    Differences
    Expression1Expression2Difference
    displayStartfirstCategoryIndexVARIABLE_NAME_MISMATCH
    doubleintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.ModuloAxisorg.jfree.data.category.SlidingCategoryDatasetVARIABLE_TYPE_MISMATCH
    displayStartfirstCategoryIndexVARIABLE_NAME_MISMATCH
    doubleintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.displayStart does not match with type int of variable this.firstCategoryIndex
    Type double of variable that.displayStart does not match with type int of variable that.firstCategoryIndex
    • Make classes org.jfree.chart.axis.ModuloAxis and org.jfree.data.category.SlidingCategoryDataset extend a common superclass
    Expression that.displayStart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.firstCategoryIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.displayStart does not match with type int of variable that.firstCategoryIndex
    6
    if (this.firstCategoryIndex != that.firstCategoryIndex)
    7
    return false;
    7
    return false;
    8
    if (this.displayEnd != that.displayEnd)
    8
    if (this.displayEnd != that.displayEnd)
    8
    if (this.maximumCategoryCount != that.maximumCategoryCount)
    Differences
    Expression1Expression2Difference
    displayEndmaximumCategoryCountVARIABLE_NAME_MISMATCH
    doubleintVARIABLE_TYPE_MISMATCH
    org.jfree.chart.axis.ModuloAxisorg.jfree.data.category.SlidingCategoryDatasetVARIABLE_TYPE_MISMATCH
    displayEndmaximumCategoryCountVARIABLE_NAME_MISMATCH
    doubleintVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type double of variable this.displayEnd does not match with type int of variable this.maximumCategoryCount
    Type double of variable that.displayEnd does not match with type int of variable that.maximumCategoryCount
    • Make classes org.jfree.chart.axis.ModuloAxis and org.jfree.data.category.SlidingCategoryDataset extend a common superclass
    Expression that.displayEnd cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.maximumCategoryCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type double of variable that.displayEnd does not match with type int of variable that.maximumCategoryCount
    8
    if (this.maximumCategoryCount != that.maximumCategoryCount)
    9
    return false;
    9
    return false;
    10
    if (!this.fixedRange.equals(that.fixedRange))
    10
    if (!this.fixedRange.equals(that.fixedRange))
    10
    if (!this.underlying.equals(that.underlying))
    Differences
    Expression1Expression2Difference
    org.jfree.chart.axis.ModuloAxisorg.jfree.data.category.SlidingCategoryDatasetVARIABLE_TYPE_MISMATCH
    fixedRangeunderlyingVARIABLE_NAME_MISMATCH
    org.jfree.data.Rangeorg.jfree.data.category.CategoryDatasetVARIABLE_TYPE_MISMATCH
    fixedRangeunderlyingVARIABLE_NAME_MISMATCH
    org.jfree.data.Rangeorg.jfree.data.category.CategoryDatasetVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.data.Range of variable that.fixedRange does not match with type org.jfree.data.category.CategoryDataset of variable that.underlying
    • Make classes org.jfree.chart.axis.ModuloAxis and org.jfree.data.category.SlidingCategoryDataset extend a common superclass
    Expression that.fixedRange cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.underlying cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type org.jfree.data.Range of variable that.fixedRange does not match with type org.jfree.data.category.CategoryDataset of variable that.underlying
    • Make classes org.jfree.data.Range and org.jfree.data.category.CategoryDataset extend a common superclass
    Type org.jfree.data.Range of variable this.fixedRange does not match with type org.jfree.data.category.CategoryDataset of variable this.underlying
    • Make classes org.jfree.data.Range and org.jfree.data.category.CategoryDataset extend a common superclass
    10
    if (!this.underlying.equals(that.underlying))
    11
    return false;
    11
    return false;
    12
    return super.equals(obj);
    12
    return super.equals(obj);
    12
    return true;
    Differences
    Expression1Expression2Difference
    super.equals(obj)trueTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Super method call return super.equals(obj); cannot be extracted from method
    12
    return true;
    Precondition Violations (18)
    Row Violation
    1Type org.jfree.chart.axis.ModuloAxis does not match with type org.jfree.data.category.SlidingCategoryDataset
    2Type double of variable this.displayStart does not match with type int of variable this.firstCategoryIndex
    3Type double of variable that.displayStart does not match with type int of variable that.firstCategoryIndex
    4Expression that.displayStart cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.firstCategoryIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Type double of variable that.displayStart does not match with type int of variable that.firstCategoryIndex
    7Type double of variable this.displayEnd does not match with type int of variable this.maximumCategoryCount
    8Type double of variable that.displayEnd does not match with type int of variable that.maximumCategoryCount
    9Expression that.displayEnd cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression that.maximumCategoryCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Type double of variable that.displayEnd does not match with type int of variable that.maximumCategoryCount
    12Type org.jfree.data.Range of variable that.fixedRange does not match with type org.jfree.data.category.CategoryDataset of variable that.underlying
    13Expression that.fixedRange cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Expression that.underlying cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Type org.jfree.data.Range of variable that.fixedRange does not match with type org.jfree.data.category.CategoryDataset of variable that.underlying
    16Type org.jfree.data.Range of variable this.fixedRange does not match with type org.jfree.data.category.CategoryDataset of variable this.underlying
    17Super method call return super.equals(obj); cannot be extracted from method
    18The refactoring of the clones is infeasible, because classes org.jfree.chart.axis.ModuloAxis and org.jfree.data.category.SlidingCategoryDataset do not have a common superclass