43-19-147

if (obj == this) { return true; } if (!(obj instanceof LogFormat)) { return false; } LogFormat that = (LogFormat) obj; if (this.base != that.base) { return false; } if (!this.baseLabel.equals(that.baseLabel)) { return false; } if (this.baseLog != that.baseLog) { return false; } if (this.showBase != that.showBase) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof XYDifferenceRenderer)) { return false; } if (!super.equals(obj)) { return false; } XYDifferenceRenderer that = (XYDifferenceRenderer) obj; if (!PaintUtilities.equal(this.positivePaint, that.positivePaint)) { return false; } if (!PaintUtilities.equal(this.negativePaint, that.negativePaint)) { return false; } if (this.shapesVisible != that.shapesVisible) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } if (this.roundXCoordinates != that.roundXCoordinates) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/util/LogFormat.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/XYDifferenceRenderer.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 LogFormat)) {↵

4

            if (!(obj instanceof XYDifferenceRenderer)) {↵

5

                return false;↵

5

                return false;   ↵

6

            }↵

6

            }↵

7

            LogFormat that = (LogFormat) obj;↵

7

            ↵

8

            if (this.base != that.base↵

8

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

9

                return false;   ↵

10

            }↵

11

            XYDifferenceRenderer that = (XYDifferenceRenderer) obj;↵

9

    ) {↵

12

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

10

                return false;↵

13

                return false;   ↵

11

            }↵

14

            }↵

12

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

15

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

13

                return false;↵

16

                return false;   ↵

14

            }↵

17

            }↵

15

            if (this.baseLog != that.baseLog↵

18

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

19

                return false;   ↵

20

            }↵

16

    ) {↵

21

            if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) {↵

17

                return false;↵

22

                return false;   ↵

18

            }↵

23

            }↵

19

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

24

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

20

                return false;↵

25

                return false;↵

21

            }↵

26

            }↵

22

            return super.equals(obj);

27

            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.2
Clones location | Clones are in different classes
Number of node comparisons | 79

1. {Non-refactorable}

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

   3 | if (!(obj instanceof LogFormat))
   3 | if (!(obj instanceof XYDifferenceRenderer))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.util.LogFormat | org.jfree.chart.renderer.xy.XYDifferenceRenderer | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof XYDifferenceRenderer))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       LogFormat that = (LogFormat)obj;

   6

       if (this.base != that.base)

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

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

   8 | if (! this.baseLabel.equals(that.baseLabel))
   5 | if (! super.equals(obj))

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

   5

       if (!super.equals(obj))

   9

       return false;

   9 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   7

       XYDifferenceRenderer that = (XYDifferenceRenderer)obj;

   8

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

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

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

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   10

       if (this.baseLog != that.baseLog)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.showBase != that.showBase)

   12 | if (this.showBase != that.showBase)
   12 | if (this.shapesVisible != that.shapesVisible)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   showBase | shapesVisible | VARIABLE_NAME_MISMATCH
   org.jfree.chart.util.LogFormat | org.jfree.chart.renderer.xy.XYDifferenceRenderer | VARIABLE_TYPE_MISMATCH
   showBase | shapesVisible | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.util.LogFormat of variable that does not match with type org.jfree.chart.renderer.xy.XYDifferenceRenderer of variable that
   - Make classes org.jfree.chart.util.LogFormat and org.jfree.chart.renderer.xy.XYDifferenceRenderer extend a common superclass

   12

       if (this.shapesVisible != that.shapesVisible)

   13

       return false;

   13 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   Precondition Violations (14)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof LogFormat does not match with type boolean of variable obj instanceof XYDifferenceRenderer
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Type org.jfree.chart.util.LogFormat of variable that does not match with type org.jfree.chart.renderer.xy.XYDifferenceRenderer of variable that
   7 | Conditional return true;
   8 | Conditional return true;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;