43-21-59

if (obj == this) { return true; } if (!(obj instanceof XYErrorRenderer)) { return false; } XYErrorRenderer that = (XYErrorRenderer) obj; if (this.drawXError != that.drawXError) { return false; } if (this.drawYError != that.drawYError) { return false; } if (this.capLength != that.capLength) { return false; } if (!PaintUtilities.equal(this.errorPaint, that.errorPaint)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof StandardCategoryURLGenerator)) { return false; } StandardCategoryURLGenerator that = (StandardCategoryURLGenerator) obj; if (!ObjectUtilities.equal(this.prefix, that.prefix)) { return false; } if (!ObjectUtilities.equal(this.seriesParameterName, that.seriesParameterName)) { return false; } if (!ObjectUtilities.equal(this.categoryParameterName, that.categoryParameterName)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYErrorRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/urls/StandardCategoryURLGenerator.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | 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 XYErrorRenderer)) {↵

4

            if (!(obj instanceof StandardCategoryURLGenerator)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            XYErrorRenderer that = (XYErrorRenderer) obj;↵

7

            StandardCategoryURLGenerator that = (StandardCategoryURLGenerator) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

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

11

            if (↵

12

                return false;↵

12

    !ObjectUtilities.equal(this.seriesParameterName,↵

13

            }↵

13

            ↵

14

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

14

            that.seriesParameterName)) {↵

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

            if (!PaintUtilities.equal(this.errorPaint,↵

17

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

18

     that.errorPaint)) {↵

18

                    that.categoryParameterName)) {↵

19

                return false;↵

19

                return false;↵

20

            }↵

20

            }↵

21

            return super.equals(obj);

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

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.6
   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 XYErrorRenderer))

   3 | if (!(obj instanceof XYErrorRenderer))
   3 | if (!(obj instanceof StandardCategoryURLGenerator))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.XYErrorRenderer | org.jfree.chart.urls.StandardCategoryURLGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof XYErrorRenderer does not match with type boolean of variable obj instanceof StandardCategoryURLGenerator
   - Make classes org.jfree.chart.renderer.xy.XYErrorRenderer and org.jfree.chart.urls.StandardCategoryURLGenerator extend a common superclass

   3

       if (!(obj instanceof StandardCategoryURLGenerator))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       StandardCategoryURLGenerator that = (StandardCategoryURLGenerator)obj;

   5

       XYErrorRenderer that = (XYErrorRenderer)obj;

   6

       if (this.drawXError != that.drawXError)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (this.drawYError != that.drawYError)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.capLength != that.capLength)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   12 | if (! PaintUtilities.equal(this.errorPaint, that.errorPaint))
   6 | if (! ObjectUtilities.equal(this.prefix, that.prefix))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   errorPaint | prefix | VARIABLE_NAME_MISMATCH
   java.awt.Paint | java.lang.String | VARIABLE_TYPE_MISMATCH
   org.jfree.util.PaintUtilities | org.jfree.util.ObjectUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

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

   6

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

   13

       return false;

   13 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   Precondition Violations (12)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof XYErrorRenderer does not match with type boolean of variable obj instanceof StandardCategoryURLGenerator
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Type java.awt.Paint of variable this.errorPaint does not match with type java.lang.String of variable this.prefix
   6 | Type org.jfree.util.PaintUtilities of variable PaintUtilities does not match with type org.jfree.util.ObjectUtilities of variable ObjectUtilities
   7 | Conditional return true;
   8 | Conditional return true;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;