43-15-64

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 AbstractCategoryItemLabelGenerator)) { return false; } AbstractCategoryItemLabelGenerator that = (AbstractCategoryItemLabelGenerator) obj; if (!this.labelFormat.equals(that.labelFormat)) { return false; } if (!ObjectUtilities.equal(this.dateFormat, that.dateFormat)) { return false; } if (!ObjectUtilities.equal(this.numberFormat, that.numberFormat)) { 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/labels/AbstractCategoryItemLabelGenerator.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 DateAxis)) {↵

4

            if (!(obj instanceof AbstractCategoryItemLabelGenerator)) {↵

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

            AbstractCategoryItemLabelGenerator that ↵

9

                = (AbstractCategoryItemLabelGenerator) obj;↵

13

    )) {↵

10

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

14

                return false;↵

11

                return false;↵

15

            }↵

12

            }↵

16

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

13

            if (!ObjectUtilities.equal(this.↵

17

                    that.tickMarkPosition)) {↵

14

    dateFormat, that.dateFormat)) {↵

18

                return false;↵

15

                return false;↵

19

            }↵

16

            }↵

20

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

17

            if (!ObjectUtilities.equal(this.↵

21

                return false;↵

22

            }↵

23

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

18

    numberFormat, that.numberFormat)) {↵

24

                return false;↵

19

                return false;↵

25

            }↵

20

            }↵

26

            return true;

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

1. {Non-refactorable}

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.DateAxis | org.jfree.chart.labels.AbstractCategoryItemLabelGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof AbstractCategoryItemLabelGenerator))

   4

       return false;

   4

       return false;

   5

       AbstractCategoryItemLabelGenerator that = (AbstractCategoryItemLabelGenerator)obj;

   5

       DateAxis that = (DateAxis)obj;

   6

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   tickUnit | dateFormat | VARIABLE_NAME_MISMATCH
   org.jfree.chart.axis.DateTickUnit | java.text.DateFormat | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   8

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

   7

       return false;

   9

       return false;

   8

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

   8 | if (! ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
   10 | if (! ObjectUtilities.equal(this.numberFormat, that.numberFormat))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   dateFormatOverride | numberFormat | VARIABLE_NAME_MISMATCH
   org.jfree.chart.axis.DateAxis | org.jfree.chart.labels.AbstractCategoryItemLabelGenerator | VARIABLE_TYPE_MISMATCH
   dateFormatOverride | numberFormat | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.axis.DateAxis of variable that does not match with type org.jfree.chart.labels.AbstractCategoryItemLabelGenerator of variable that
   - Make classes org.jfree.chart.axis.DateAxis and org.jfree.chart.labels.AbstractCategoryItemLabelGenerator extend a common superclass

   10

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

   9

       return false;

   11

       return false;

   10

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

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (!super.equals(obj))

   14 | if (! super.equals(obj))
   6 | if (! this.labelFormat.equals(that.labelFormat))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   super.equals(obj) | this.labelFormat.equals(that.labelFormat) | TYPE_COMPATIBLE_REPLACEMENT

   6

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

   15

       return false;

   7

       return false;

   16

       return true;

   12

       return true;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof DateAxis does not match with type boolean of variable obj instanceof AbstractCategoryItemLabelGenerator
   2 | Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.text.DateFormat of variable this.dateFormat
   3 | Type org.jfree.chart.axis.DateAxis of variable that does not match with type org.jfree.chart.labels.AbstractCategoryItemLabelGenerator of variable that
   4 | Unmatched return false;
   5 | Unmatched return false;