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;
if (obj == this) { return true; } if (!(obj instanceof TimeSeriesCollection)) { return false; } TimeSeriesCollection that = (TimeSeriesCollection) obj; if (this.xPosition != that.xPosition) { return false; } if (this.domainIsPointsInTime != that.domainIsPointsInTime) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/gantt/SlidingGanttCategoryDataset.java File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimeSeriesCollection.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 SlidingGanttCategoryDataset)) {
4
        if (!(obj instanceof 
6
			return false;
7
		}
8
		SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) obj;
9
		if (this.firstCategoryIndex != that.firstCategoryIndex) {
10
			return false;
11
		}
12
		
5
TimeSeriesCollection)) {
6
            return false;
7
        }
8
        TimeSeriesCollection that = (TimeSeriesCollection) obj;
9
        if (this.xPosition != that.xPosition) {
10
            return false;
11
        }
13
if (this.maximumCategoryCount != that.maximumCategoryCount) {
12
        if (this.domainIsPointsInTime != that.
14
			return false;
15
		}
16
		if (!this.underlying.equals(that.underlying)) {
17
			return false;
18
		}
19
		
13
domainIsPointsInTime) {
14
            return false;
15
        }
16
        if (!ObjectUtilities.equal(this.data, that.data)) {
17
            return false;
18
        }
20
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.3
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.1
    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 SlidingGanttCategoryDataset))
    3
    if (!(obj instanceof SlidingGanttCategoryDataset))
    3
    if (!(obj instanceof TimeSeriesCollection))
    Differences
    Expression1Expression2Difference
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    3
    if (!(obj instanceof TimeSeriesCollection))
    4
    return false;
    4
    return false;
    5
    SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset)obj;
    5
    SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset)obj;
    5
    TimeSeriesCollection that = (TimeSeriesCollection)obj;
    Differences
    Expression1Expression2Difference
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    5
    TimeSeriesCollection that = (TimeSeriesCollection)obj;
    6
    if (this.firstCategoryIndex != that.firstCategoryIndex)
    6
    if (this.firstCategoryIndex != that.firstCategoryIndex)
    6
    if (this.xPosition != that.xPosition)
    Differences
    Expression1Expression2Difference
    firstCategoryIndexxPositionVARIABLE_NAME_MISMATCH
    intorg.jfree.data.time.TimePeriodAnchorVARIABLE_TYPE_MISMATCH
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    firstCategoryIndexxPositionVARIABLE_NAME_MISMATCH
    intorg.jfree.data.time.TimePeriodAnchorVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.firstCategoryIndex does not match with type org.jfree.data.time.TimePeriodAnchor of variable this.xPosition
    Expression that.firstCategoryIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.xPosition cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.firstCategoryIndex does not match with type org.jfree.data.time.TimePeriodAnchor of variable that.xPosition
    6
    if (this.xPosition != that.xPosition)
    7
    return false;
    7
    return false;
    8
    if (this.maximumCategoryCount != that.maximumCategoryCount)
    8
    if (this.maximumCategoryCount != that.maximumCategoryCount)
    8
    if (this.domainIsPointsInTime != that.domainIsPointsInTime)
    Differences
    Expression1Expression2Difference
    maximumCategoryCountdomainIsPointsInTimeVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    org.jfree.data.gantt.SlidingGanttCategoryDatasetorg.jfree.data.time.TimeSeriesCollectionSUBCLASS_TYPE_MISMATCH
    maximumCategoryCountdomainIsPointsInTimeVARIABLE_NAME_MISMATCH
    intbooleanVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type int of variable this.maximumCategoryCount does not match with type boolean of variable this.domainIsPointsInTime
    Expression that.maximumCategoryCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression that.domainIsPointsInTime cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Type int of variable that.maximumCategoryCount does not match with type boolean of variable that.domainIsPointsInTime
    8
    if (this.domainIsPointsInTime != that.domainIsPointsInTime)
    9
    return false;
    9
    return false;
    10
    if (!this.underlying.equals(that.underlying))
    10
    if (!this.underlying.equals(that.underlying))
    10
    if (!ObjectUtilities.equal(this.data, that.data))
    Differences
    Expression1Expression2Difference
    this.underlying.equals(that.underlying)ObjectUtilities.equal(this.data,that.data)TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression this.underlying.equals(that.underlying) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression ObjectUtilities.equal(this.data,that.data) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    if (!ObjectUtilities.equal(this.data, that.data))
    11
    return false;
    11
    return false;
    12
    return true;
    12
    return true;
    Precondition Violations (10)
    Row Violation
    1Type int of variable this.firstCategoryIndex does not match with type org.jfree.data.time.TimePeriodAnchor of variable this.xPosition
    2Expression that.firstCategoryIndex cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression that.xPosition cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Type int of variable that.firstCategoryIndex does not match with type org.jfree.data.time.TimePeriodAnchor of variable that.xPosition
    5Type int of variable this.maximumCategoryCount does not match with type boolean of variable this.domainIsPointsInTime
    6Expression that.maximumCategoryCount cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression that.domainIsPointsInTime cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Type int of variable that.maximumCategoryCount does not match with type boolean of variable that.domainIsPointsInTime
    9Expression this.underlying.equals(that.underlying) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression ObjectUtilities.equal(this.data,that.data) cannot be parameterized, because it has dependencies to/from statements that will be extracted