43-13-75

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 ExtendedCategoryAxis)) { return false; } ExtendedCategoryAxis that = (ExtendedCategoryAxis) obj; if (!this.sublabelFont.equals(that.sublabelFont)) { return false; } if (!PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint)) { return false; } if (!this.sublabels.equals(that.sublabels)) { return false; } return super.equals(obj);

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/chart/axis/ExtendedCategoryAxis.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 ExtendedCategoryAxis)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            MeterInterval that = (MeterInterval) obj;↵

7

            ExtendedCategoryAxis that = (ExtendedCategoryAxis) obj;↵

8

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

8

            if (!this.sublabelFont.equals(that.sublabel↵

9

                return false;↵

10

            }↵

11

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

9

    Font)) {↵

12

                return false;↵

10

                return false;↵

13

            }↵

11

            }↵

14

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

12

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

15

                return false;↵

13

                return false;↵

16

            }↵

14

            }↵

17

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

15

            if (!↵

18

                return false;↵

19

            }↵

20

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

16

    this.sublabels.equals(that.sublabels)) {↵

21

                return false;↵

17

                return false;↵

22

            }↵

18

            }↵

23

            return true;

19

            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.1
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.4
   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 MeterInterval))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MeterInterval | org.jfree.chart.axis.ExtendedCategoryAxis | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof ExtendedCategoryAxis))

   4

       return false;

   4

       return false;

   5

       ExtendedCategoryAxis that = (ExtendedCategoryAxis)obj;

   5

       MeterInterval that = (MeterInterval)obj;

   6

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

   6 | if (! this.label.equals(that.label))
   6 | if (! this.sublabelFont.equals(that.sublabelFont))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MeterInterval | org.jfree.chart.axis.ExtendedCategoryAxis | VARIABLE_TYPE_MISMATCH
   label | sublabelFont | VARIABLE_NAME_MISMATCH
   java.lang.String | java.awt.Font | VARIABLE_TYPE_MISMATCH
   label | sublabelFont | VARIABLE_NAME_MISMATCH
   java.lang.String | java.awt.Font | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.MeterInterval of variable that does not match with type org.jfree.chart.axis.ExtendedCategoryAxis of variable that
   - Make classes org.jfree.chart.plot.MeterInterval and org.jfree.chart.axis.ExtendedCategoryAxis extend a common superclass

   Type java.lang.String of variable that.label does not match with type java.awt.Font of variable that.sublabelFont
   - Make classes java.lang.String and java.awt.Font extend a common superclass

   Type java.lang.String of variable this.label does not match with type java.awt.Font of variable this.sublabelFont
   - Make classes java.lang.String and java.awt.Font extend a common superclass

   6

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

   7

       return false;

   7

       return false;

   8

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

   8 | if (! this.range.equals(that.range))
   10 | if (! this.sublabels.equals(that.sublabels))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MeterInterval | org.jfree.chart.axis.ExtendedCategoryAxis | VARIABLE_TYPE_MISMATCH
   range | sublabels | VARIABLE_NAME_MISMATCH
   org.jfree.data.Range | java.util.Map | VARIABLE_TYPE_MISMATCH
   range | sublabels | VARIABLE_NAME_MISMATCH
   org.jfree.data.Range | java.util.Map | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.MeterInterval of variable that does not match with type org.jfree.chart.axis.ExtendedCategoryAxis of variable that
   - Make classes org.jfree.chart.plot.MeterInterval and org.jfree.chart.axis.ExtendedCategoryAxis extend a common superclass

   Type org.jfree.data.Range of variable that.range does not match with type java.util.Map of variable that.sublabels
   - Make classes org.jfree.data.Range and java.util.Map extend a common superclass

   Type org.jfree.data.Range of variable this.range does not match with type java.util.Map of variable this.sublabels
   - Make classes org.jfree.data.Range and java.util.Map extend a common superclass

   10

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

   9

       return false;

   11

       return false;

   10

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

   10 | if (! PaintUtilities.equal(this.outlinePaint, that.outlinePaint))
   8 | if (! PaintUtilities.equal(this.sublabelPaint, that.sublabelPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   outlinePaint | sublabelPaint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.MeterInterval | org.jfree.chart.axis.ExtendedCategoryAxis | VARIABLE_TYPE_MISMATCH
   outlinePaint | sublabelPaint | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.MeterInterval of variable that does not match with type org.jfree.chart.axis.ExtendedCategoryAxis of variable that
   - Make classes org.jfree.chart.plot.MeterInterval and org.jfree.chart.axis.ExtendedCategoryAxis extend a common superclass

   8

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

   11

       return false;

   9

       return false;

   12

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

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

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

   15

       return false;

   15 | return false;

   Preondition Violations
   Unmatched return false;

   16

       return true;

   16 | return true;
   12 | return super.equals(obj);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   true | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   12

       return super.equals(obj);

   Precondition Violations (10)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof MeterInterval does not match with type boolean of variable obj instanceof ExtendedCategoryAxis
   2 | Type org.jfree.chart.plot.MeterInterval of variable that does not match with type org.jfree.chart.axis.ExtendedCategoryAxis of variable that
   3 | Type java.lang.String of variable that.label does not match with type java.awt.Font of variable that.sublabelFont
   4 | Type java.lang.String of variable this.label does not match with type java.awt.Font of variable this.sublabelFont
   5 | Type org.jfree.chart.plot.MeterInterval of variable that does not match with type org.jfree.chart.axis.ExtendedCategoryAxis of variable that
   6 | Type org.jfree.data.Range of variable that.range does not match with type java.util.Map of variable that.sublabels
   7 | Type org.jfree.data.Range of variable this.range does not match with type java.util.Map of variable this.sublabels
   8 | Type org.jfree.chart.plot.MeterInterval of variable that does not match with type org.jfree.chart.axis.ExtendedCategoryAxis of variable that
   9 | Unmatched return false;
   10 | Unmatched return false;