23-1-6

if (obj == this) { return true; } if (!(obj instanceof RelativeDateFormat)) { return false; } if (!super.equals(obj)) { return false; } RelativeDateFormat that = (RelativeDateFormat) obj; if (this.baseMillis != that.baseMillis) { return false; } if (this.showZeroDays != that.showZeroDays) { return false; } if (this.showZeroHours != that.showZeroHours) { return false; } if (!this.positivePrefix.equals(that.positivePrefix)) { return false; } if (!this.daySuffix.equals(that.daySuffix)) { return false; } if (!this.hourSuffix.equals(that.hourSuffix)) { return false; } if (!this.minuteSuffix.equals(that.minuteSuffix)) { return false; } if (!this.secondSuffix.equals(that.secondSuffix)) { return false; } if (!this.secondFormatter.equals(that.secondFormatter)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof CategoryPointerAnnotation)) { return false; } if (!super.equals(obj)) { return false; } CategoryPointerAnnotation that = (CategoryPointerAnnotation) obj; if (this.angle != that.angle) { return false; } if (this.tipRadius != that.tipRadius) { return false; } if (this.baseRadius != that.baseRadius) { return false; } if (this.arrowLength != that.arrowLength) { return false; } if (this.arrowWidth != that.arrowWidth) { return false; } if (!this.arrowPaint.equals(that.arrowPaint)) { return false; } if (!ObjectUtilities.equal(this.arrowStroke, that.arrowStroke)) { return false; } if (this.labelOffset != that.labelOffset) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/util/RelativeDateFormat.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/annotations/CategoryPointerAnnotation.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 26 |  | Number of AST nodes: 24

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof RelativeDateFormat)) {↵

4

            if (!(obj instanceof CategoryPointerAnnotation)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

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

7

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

8

                return false;↵

8

                return false;↵

9

            }↵

9

            }↵

10

            RelativeDateFormat that = (RelativeDateFormat) obj;↵

10

            CategoryPointerAnnotation that = (CategoryPointerAnnotation) obj;↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

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

17

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

18

                return false;↵

18

                return false;↵

19

            }↵

19

            }↵

20

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

20

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

21

                return false;↵

21

                return false;↵

22

            }↵

22

            }↵

23

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

23

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

24

                return false;↵

24

                return false;↵

25

            }↵

25

            }↵

26

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

26

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

27

                return false;↵

27

                return false;↵

28

            }↵

28

            }↵

29

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

29

            if (!↵

30

                return false;↵

31

            }↵

32

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

30

    ObjectUtilities.equal(this.arrowStroke, that.arrowStroke)) {↵

33

                return false;↵

31

                return false;↵

34

            }↵

32

            }↵

35

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

33

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

36

                return false;↵

34

                return false;↵

37

            }↵

35

            }↵

38

            return true;

36

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 8
   Number of unmapped statements in the first code fragment | 7
   Number of unmapped statements in the second code fragment | 11
   Time elapsed for statement mapping (ms) | 1.9
   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 RelativeDateFormat))

   3 | if (!(obj instanceof RelativeDateFormat))
   3 | if (!(obj instanceof CategoryPointerAnnotation))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.util.RelativeDateFormat | org.jfree.chart.annotations.CategoryPointerAnnotation | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof RelativeDateFormat does not match with type boolean of variable obj instanceof CategoryPointerAnnotation
   - Make classes org.jfree.chart.util.RelativeDateFormat and org.jfree.chart.annotations.CategoryPointerAnnotation extend a common superclass

   3

       if (!(obj instanceof CategoryPointerAnnotation))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       if (!super.equals(obj))

   5

       if (!super.equals(obj))

   6

       return false;

   6 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   7

       CategoryPointerAnnotation that = (CategoryPointerAnnotation)obj;

   7

       RelativeDateFormat that = (RelativeDateFormat)obj;

   8

       if (this.angle != that.angle)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   8

       if (this.baseMillis != that.baseMillis)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.tipRadius != that.tipRadius)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   10

       if (this.showZeroDays != that.showZeroDays)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.baseRadius != that.baseRadius)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   12

       if (this.showZeroHours != that.showZeroHours)

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (this.arrowLength != that.arrowLength)

   15 | return false;

   Preondition Violations
   Unmatched return false;

   15

       return false;

   16

       if (this.arrowWidth != that.arrowWidth)

   17 | return false;

   Preondition Violations
   Unmatched return false;

   17

       return false;

   14

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

   14 | if (! this.positivePrefix.equals(that.positivePrefix))
   18 | if (! this.arrowPaint.equals(that.arrowPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.util.RelativeDateFormat | org.jfree.chart.annotations.CategoryPointerAnnotation | VARIABLE_TYPE_MISMATCH
   positivePrefix | arrowPaint | VARIABLE_NAME_MISMATCH
   java.lang.String | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   positivePrefix | arrowPaint | VARIABLE_NAME_MISMATCH
   java.lang.String | java.awt.Paint | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.util.RelativeDateFormat of variable that does not match with type org.jfree.chart.annotations.CategoryPointerAnnotation of variable that
   - Make classes org.jfree.chart.util.RelativeDateFormat and org.jfree.chart.annotations.CategoryPointerAnnotation extend a common superclass

   Type java.lang.String of variable that.positivePrefix does not match with type java.awt.Paint of variable that.arrowPaint
   - Make classes java.lang.String and java.awt.Paint extend a common superclass

   Type java.lang.String of variable this.positivePrefix does not match with type java.awt.Paint of variable this.arrowPaint
   - Make classes java.lang.String and java.awt.Paint extend a common superclass

   18

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

   15

       return false;

   15 | return false;
   19 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   19

       return false;

   Precondition Violations (20)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof RelativeDateFormat does not match with type boolean of variable obj instanceof CategoryPointerAnnotation
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Unmatched return false;
   7 | Unmatched return false;
   8 | Unmatched return false;
   9 | Unmatched return false;
   10 | Type org.jfree.chart.util.RelativeDateFormat of variable that does not match with type org.jfree.chart.annotations.CategoryPointerAnnotation of variable that
   11 | Type java.lang.String of variable that.positivePrefix does not match with type java.awt.Paint of variable that.arrowPaint
   12 | Type java.lang.String of variable this.positivePrefix does not match with type java.awt.Paint of variable this.arrowPaint
   13 | Conditional return true;
   14 | Conditional return true;
   15 | Conditional return false;
   16 | Conditional return false;
   17 | Conditional return false;
   18 | Conditional return false;
   19 | Conditional return false;
   20 | Conditional return false;