43-13-40

if (obj == this) { return true; } if (!(obj instanceof MeterInterval)) { return false; } MeterInterval that = (MeterInterval) obj; if (!this.label.equals(that.label)) { return false; } if (!this.range.equals(that.range)) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof IntervalXYDelegate)) { return false; } IntervalXYDelegate that = (IntervalXYDelegate) obj; if (this.autoWidth != that.autoWidth) { return false; } if (this.intervalPositionFactor != that.intervalPositionFactor) { return false; } if (this.fixedIntervalWidth != that.fixedIntervalWidth) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/MeterInterval.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/IntervalXYDelegate.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | 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 MeterInterval)) {↵

4

            if (!(obj instanceof IntervalXYDelegate)) {↵

5

                return false;↵

5

                return false;   ↵

6

            }↵

6

            }↵

7

            MeterInterval that = (MeterInterval) obj;↵

7

            IntervalXYDelegate that = (IntervalXYDelegate) obj;↵

8

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

8

            if (this.autoWidth != that.autoWidth) {↵

9

                return false;↵

9

                return false;   ↵

10

            }↵

10

            }↵

11

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

11

            if (this.↵

12

                return false;↵

13

            }↵

14

            if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) {↵

15

                return false;↵

16

            }↵

17

            if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) {↵

12

    intervalPositionFactor != that.intervalPositionFactor) {↵

18

                return false;↵

13

                return false;   ↵

19

            }↵

14

            }↵

20

            if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) {↵

15

            if (this.fixedIntervalWidth != that.fixedIntervalWidth) {↵

21

                return false;↵

16

                return false;   ↵

22

            }↵

17

            }↵

23

            return true;

18

            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 | 44

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 4
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 0.4
   Clone type | Type 2

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

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2 | return true;
   2 | return true;

   Preondition Violations
   Conditional return true;
   Conditional return true;

   2

       return true;

   3

       if (!(obj instanceof MeterInterval))

   3 | if (!(obj instanceof MeterInterval))
   3 | if (!(obj instanceof IntervalXYDelegate))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MeterInterval | org.jfree.data.xy.IntervalXYDelegate | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof MeterInterval does not match with type boolean of variable obj instanceof IntervalXYDelegate
   - Make classes org.jfree.chart.plot.MeterInterval and org.jfree.data.xy.IntervalXYDelegate extend a common superclass

   3

       if (!(obj instanceof IntervalXYDelegate))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof MeterInterval does not match with type boolean of variable obj instanceof IntervalXYDelegate
   2 | Conditional return true;
   3 | Conditional return true;
   4 | Conditional return false;
   5 | Conditional return false;