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;
if (obj == this) { return true; } if (!(obj instanceof SlidingGanttCategoryDataset)) { return false; } SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) 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/data/category/SlidingCategoryDataset.java File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/SlidingGanttCategoryDataset.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 SlidingCategoryDataset)) {
4
		if (!(obj instanceof SlidingGanttCategoryDataset)) {
5
			return false;
5
			return false;
6
		}
6
		}
7
		SlidingCategoryDataset that = (SlidingCategoryDataset) obj;
7
		SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) obj;
8
		if (this.firstCategoryIndex != that.firstCategoryIndex) {
8
		if (this.firstCategoryIndex != that.firstCategoryIndex) {
9
			return false;
9
			return false;
10
		}
10
		}
11
		if (this.maximumCategoryCount != that.maximumCategoryCount) {
11
		if (this.maximumCategoryCount != that.maximumCategoryCount) {
12
			return false;
12
			return false;
13
		}
13
		}
14
		if (!this.underlying.equals(that.underlying)) {
14
		if (!this.underlying.equals(that.underlying)) {
15
			return false;
15
			return false;
16
		}
16
		}
17
		return true;
17
		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.9
Clones locationClones are in different classes having the same super class
Number of node comparisons50
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)5.4
    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 SlidingCategoryDataset))
    3
    if (!(obj instanceof SlidingCategoryDataset))
    3
    if (!(obj instanceof SlidingGanttCategoryDataset))
    Differences
    Expression1Expression2Difference
    org.jfree.data.category.SlidingCategoryDatasetorg.jfree.data.gantt.SlidingGanttCategoryDatasetSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof SlidingGanttCategoryDataset))
    4
    return false;
    4
    return false;
    5
    SlidingCategoryDataset that = (SlidingCategoryDataset)obj;
    5
    SlidingCategoryDataset that = (SlidingCategoryDataset)obj;
    5
    SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.data.category.SlidingCategoryDatasetorg.jfree.data.gantt.SlidingGanttCategoryDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.data.category.SlidingCategoryDatasetorg.jfree.data.gantt.SlidingGanttCategoryDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.data.category.SlidingCategoryDatasetorg.jfree.data.gantt.SlidingGanttCategoryDatasetSUBCLASS_TYPE_MISMATCH
    5
    SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset)obj;
    6
    if (this.firstCategoryIndex != that.firstCategoryIndex)
    6
    if (this.firstCategoryIndex != that.firstCategoryIndex)
    6
    if (this.firstCategoryIndex != that.firstCategoryIndex)
    Differences
    Expression1Expression2Difference
    org.jfree.data.category.SlidingCategoryDatasetorg.jfree.data.gantt.SlidingGanttCategoryDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.firstCategoryIndex cannot be unified with expression that.firstCategoryIndex , because common superclass org.jfree.data.general.AbstractDataset does not declare member(s) private int firstCategoryIndex
    6
    if (this.firstCategoryIndex != that.firstCategoryIndex)
    7
    return false;
    7
    return false;
    8
    if (this.maximumCategoryCount != that.maximumCategoryCount)
    8
    if (this.maximumCategoryCount != that.maximumCategoryCount)
    8
    if (this.maximumCategoryCount != that.maximumCategoryCount)
    Differences
    Expression1Expression2Difference
    org.jfree.data.category.SlidingCategoryDatasetorg.jfree.data.gantt.SlidingGanttCategoryDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.maximumCategoryCount cannot be unified with expression that.maximumCategoryCount , because common superclass org.jfree.data.general.AbstractDataset does not declare member(s) private int maximumCategoryCount
    8
    if (this.maximumCategoryCount != that.maximumCategoryCount)
    9
    return false;
    9
    return false;
    10
    if (!this.underlying.equals(that.underlying))
    10
    if (!this.underlying.equals(that.underlying))
    10
    if (!this.underlying.equals(that.underlying))
    Differences
    Expression1Expression2Difference
    org.jfree.data.category.SlidingCategoryDatasetorg.jfree.data.gantt.SlidingGanttCategoryDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.data.category.CategoryDatasetorg.jfree.data.gantt.GanttCategoryDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.data.category.CategoryDatasetorg.jfree.data.gantt.GanttCategoryDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression that.underlying cannot be unified with expression that.underlying , because common superclass type org.jfree.data.category.CategoryDataset cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression that.underlying 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
    Expression that.underlying cannot be unified with expression that.underlying , because common superclass type org.jfree.data.category.CategoryDataset cannot be passed as an argument to public boolean equals(java.lang.Object)
    10
    if (!this.underlying.equals(that.underlying))
    11
    return false;
    11
    return false;
    12
    return true;
    12
    return true;
    Precondition Violations (6)
    Row Violation
    1Expression that.firstCategoryIndex cannot be unified with expression that.firstCategoryIndex , because common superclass org.jfree.data.general.AbstractDataset does not declare member(s) private int firstCategoryIndex
    2Expression that.maximumCategoryCount cannot be unified with expression that.maximumCategoryCount , because common superclass org.jfree.data.general.AbstractDataset does not declare member(s) private int maximumCategoryCount
    3Expression that.underlying cannot be unified with expression that.underlying , because common superclass type org.jfree.data.category.CategoryDataset cannot be passed as an argument to public boolean equals(java.lang.Object)
    4Expression that.underlying cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression that.underlying cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression that.underlying cannot be unified with expression that.underlying , because common superclass type org.jfree.data.category.CategoryDataset cannot be passed as an argument to public boolean equals(java.lang.Object)