43-15-86

if (obj == this) { return true; } if (!(obj instanceof DateAxis)) { return false; } DateAxis that = (DateAxis) obj; if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride)) { return false; } if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition)) { return false; } if (!ObjectUtilities.equal(this.timeline, that.timeline)) { return false; } if (!super.equals(obj)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof PaintItem)) { return false; } PaintItem that = (PaintItem) obj; if (this.value != that.value) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/DateAxis.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/LookupPaintScale.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | Number of AST nodes: 10

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                    return true;↵

3

            }↵

3

                }↵

4

            if (!(obj instanceof DateAxis)) {↵

4

                if (!(obj instanceof PaintItem)) {↵

5

                return false;↵

5

                    return false;↵

6

            }↵

6

                }↵

7

            DateAxis that = (DateAxis) obj;↵

7

            ↵

8

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

9

                return false;↵

10

            }↵

11

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

12

                    that.dateFormatOverride)↵

8

        PaintItem that = (PaintItem) obj;↵

13

    ) {↵

9

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

14

                return false;↵

10

                    return false;↵

15

            }↵

16

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

17

                    that.tickMarkPosition)) {↵

18

                return false;↵

11

                }↵

19

            }↵

12

        ↵

20

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

13

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

21

                return false;↵

14

                    return false;↵

22

            }↵

15

            ↵

23

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

24

                return false;↵

25

            }↵

16

        }↵

26

            return true;

17

                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) | 1.2
Clones location | Clones are in different classes
Number of node comparisons | 47

1. {Non-refactorable}

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

   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 DateAxis))

   3 | if (!(obj instanceof DateAxis))
   3 | if (!(obj instanceof PaintItem))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.DateAxis | org.jfree.chart.renderer.LookupPaintScale.PaintItem | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof PaintItem))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       PaintItem that = (PaintItem)obj;

   5

       DateAxis that = (DateAxis)obj;

   6

       if (this.value != that.value)

   7 | return false;

   Preondition Violations
   Unmatched return false;

   7

       return false;

   6

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

   6 | if (! ObjectUtilities.equal(this.tickUnit, that.tickUnit))
   8 | if (! PaintUtilities.equal(this.paint, that.paint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   tickUnit | paint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.axis.DateTickUnit | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.paint
   - Make classes org.jfree.chart.axis.DateTickUnit and java.awt.Paint extend a common superclass

   Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   - Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass

   8

       if (!PaintUtilities.equal(this.paint, that.paint))

   7

       return false;

   7 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   Precondition Violations (10)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof DateAxis does not match with type boolean of variable obj instanceof PaintItem
   2 | Unmatched return false;
   3 | Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.paint
   4 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   5 | Conditional return true;
   6 | Conditional return true;
   7 | Conditional return false;
   8 | Conditional return false;
   9 | Conditional return false;
   10 | Conditional return false;