43-126-144

if (obj == this) { return true; } if (!(obj instanceof YIntervalRenderer)) { return false; } YIntervalRenderer that = (YIntervalRenderer) obj; if (!ObjectUtilities.equal(this.additionalItemLabelGenerator, that.additionalItemLabelGenerator)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof MonthDateFormat)) { return false; } if (!super.equals(obj)) { return false; } MonthDateFormat that = (MonthDateFormat) obj; if (!Arrays.equals(this.months, that.months)) { return false; } if (!Arrays.equals(this.showYear, that.showYear)) { return false; } if (!this.yearFormatter.equals(that.yearFormatter)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/YIntervalRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/MonthDateFormat.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 8 |  | Number of AST nodes: 14

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

        		return true;↵

2

                return true;↵

3

        	}↵

3

            }↵

4

        	if (!(obj instanceof YIntervalRenderer↵

4

            if (!(obj instanceof MonthDateFormat)) {↵

5

                return false;↵

6

            }↵

5

    )) {↵

7

            if (!super.equals(obj)) {↵

6

        		return false;↵

8

                return false;↵

7

        	}↵

9

            }↵

8

        	YIntervalRenderer that = (YIntervalRenderer) obj;↵

10

            MonthDateFormat that = (MonthDateFormat) obj;↵

9

        	if (!ObjectUtilities.equal(this.additionalItemLabelGenerator,↵

11

            if (!Arrays.equals(this.↵

10

        			that.additionalItemLabelGenerato↵

12

    months, that.months)) {↵

13

                return false;↵

14

            }↵

15

            if (!Arrays.equals(this.showYear, that.showYear)) {↵

16

                return false;↵

17

            }↵

11

    r)) {↵

18

            if (!this.yearFormatter.equals(that.yearFormatter)) {↵

12

        		return false;↵

19

                return false;↵

13

        	}↵

20

            }↵

14

        	return super.equals(obj);

21

            return true;

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 0
Number of non-refactorable cases | 1
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.9
Clones location | Clones are in different classes
Number of node comparisons | 40

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 1
   Number of unmapped statements in the second code fragment | 7
   Time elapsed for statement mapping (ms) | 0.8
   Clone type | Type 3

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2

       return true;

   3

       if (!(obj instanceof YIntervalRenderer))

   3 | if (!(obj instanceof YIntervalRenderer))
   3 | if (!(obj instanceof MonthDateFormat))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.YIntervalRenderer | org.jfree.chart.axis.MonthDateFormat | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof YIntervalRenderer does not match with type boolean of variable obj instanceof MonthDateFormat
   - Make classes org.jfree.chart.renderer.xy.YIntervalRenderer and org.jfree.chart.axis.MonthDateFormat extend a common superclass

   3

       if (!(obj instanceof MonthDateFormat))

   4

       return false;

   4

       return false;

   5

       YIntervalRenderer that = (YIntervalRenderer)obj;

   6

       if (!ObjectUtilities.equal(this.additionalItemLabelGenerator, that.additionalItemLabelGenerator))

   6 | if (! ObjectUtilities.equal(this.additionalItemLabelGenerator, that.additionalItemLabelGenerator))
   5 | if (! super.equals(obj))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   ObjectUtilities.equal(this.additionalItemLabelGenerator,that.additionalItemLabelGenerator) | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   5

       if (!super.equals(obj))

   7

       return false;

   6

       return false;

   7

       MonthDateFormat that = (MonthDateFormat)obj;

   8

       if (!Arrays.equals(this.months, that.months))

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

       if (!Arrays.equals(this.showYear, that.showYear))

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   12

       if (!this.yearFormatter.equals(that.yearFormatter))

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   8

       return super.equals(obj);

   8 | return super.equals(obj);
   14 | return true;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   super.equals(obj) | true | TYPE_COMPATIBLE_REPLACEMENT

   14

       return true;

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof YIntervalRenderer does not match with type boolean of variable obj instanceof MonthDateFormat
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;