43-24-52

if (obj == this) { return true; } if (!(obj instanceof Second)) { return false; } Second that = (Second) obj; if (this.second != that.second) { return false; } if (this.minute != that.minute) { return false; } if (this.hour != that.hour) { return false; } if (!this.day.equals(that.day)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof DialTextAnnotation)) { return false; } DialTextAnnotation that = (DialTextAnnotation) obj; if (!this.label.equals(that.label)) { return false; } if (!this.font.equals(that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.radius != that.radius) { return false; } if (this.angle != that.angle) { return false; } if (!this.anchor.equals(that.anchor)) { return false; } return super.equals(obj);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/Second.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/dial/DialTextAnnotation.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | Number of AST nodes: 18

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof Second)) {↵

4

            if (!(obj instanceof DialTextAnnotation)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            Second that = (Second) obj;↵

7

            DialTextAnnotation that = (DialTextAnnotation) obj;↵

8

            if (this.second != that.second↵

8

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

9

                return false;↵

10

            }↵

9

    ) {↵

11

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

10

                return false;↵

12

                return false;↵

11

            }↵

13

            }↵

12

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

14

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

13

                return false;↵

15

                return false;↵

14

            }↵

16

            }↵

15

            if (this.hour != that.hour↵

17

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

18

                return false;↵

19

            }↵

16

    ) {↵

20

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

17

                return false;↵

21

                return false;↵

18

            }↵

22

            }↵

19

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

23

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

20

                return false;↵

24

                return false;↵

21

            }↵

25

            }↵

22

            return true;

26

            return super.equals(obj);

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 6
   Number of unmapped statements in the first code fragment | 7
   Number of unmapped statements in the second code fragment | 1
   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 Second))

   3 | if (!(obj instanceof Second))
   3 | if (!(obj instanceof DialTextAnnotation))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.Second | org.jfree.chart.plot.dial.DialTextAnnotation | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof Second does not match with type boolean of variable obj instanceof DialTextAnnotation
   - Make classes org.jfree.data.time.Second and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass

   3

       if (!(obj instanceof DialTextAnnotation))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       DialTextAnnotation that = (DialTextAnnotation)obj;

   5

       Second that = (Second)obj;

   6

       if (this.second != that.second)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (this.minute != that.minute)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.hour != that.hour)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   12 | if (! this.day.equals(that.day))
   6 | if (! this.label.equals(that.label))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.Second | org.jfree.chart.plot.dial.DialTextAnnotation | VARIABLE_TYPE_MISMATCH
   day | label | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | java.lang.String | VARIABLE_TYPE_MISMATCH
   day | label | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.Day | java.lang.String | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.time.Second of variable that does not match with type org.jfree.chart.plot.dial.DialTextAnnotation of variable that
   - Make classes org.jfree.data.time.Second and org.jfree.chart.plot.dial.DialTextAnnotation extend a common superclass

   Type org.jfree.data.time.Day of variable that.day does not match with type java.lang.String of variable that.label
   - Make classes org.jfree.data.time.Day and java.lang.String extend a common superclass

   Type org.jfree.data.time.Day of variable this.day does not match with type java.lang.String of variable this.label
   - Make classes org.jfree.data.time.Day and java.lang.String extend a common superclass

   6

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

   13

       return false;

   13 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   Precondition Violations (13)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof Second does not match with type boolean of variable obj instanceof DialTextAnnotation
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Type org.jfree.data.time.Second of variable that does not match with type org.jfree.chart.plot.dial.DialTextAnnotation of variable that
   6 | Type org.jfree.data.time.Day of variable that.day does not match with type java.lang.String of variable that.label
   7 | Type org.jfree.data.time.Day of variable this.day does not match with type java.lang.String of variable this.label
   8 | Conditional return true;
   9 | Conditional return true;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;