106-1-3

if (obj == this) { return true; } if (!(obj instanceof JFreeChart)) { return false; } JFreeChart that = (JFreeChart) obj; if (!this.renderingHints.equals(that.renderingHints)) { return false; } if (this.borderVisible != that.borderVisible) { return false; } if (!ObjectUtilities.equal(this.borderStroke, that.borderStroke)) { return false; } if (!PaintUtilities.equal(this.borderPaint, that.borderPaint)) { return false; } if (!this.padding.equals(that.padding)) { return false; } if (!ObjectUtilities.equal(this.title, that.title)) { return false; } if (!ObjectUtilities.equal(this.subtitles, that.subtitles)) { return false; } if (!ObjectUtilities.equal(this.plot, that.plot)) { return false; } if (!PaintUtilities.equal( this.backgroundPaint, that.backgroundPaint )) { return false; } if (!ObjectUtilities.equal(this.backgroundImage, that.backgroundImage)) { return false; } if (this.backgroundImageAlignment != that.backgroundImageAlignment) { return false; } if (this.backgroundImageAlpha != that.backgroundImageAlpha) { return false; } if (this.notify != that.notify) { return false; } return true;
if (!(obj instanceof LegendGraphic)) { return false; } LegendGraphic that = (LegendGraphic) obj; if (this.shapeVisible != that.shapeVisible) { return false; } if (!ShapeUtilities.equal(this.shape, that.shape)) { return false; } if (this.shapeFilled != that.shapeFilled) { return false; } if (!PaintUtilities.equal(this.fillPaint, that.fillPaint)) { return false; } if (!ObjectUtilities.equal(this.fillPaintTransformer, that.fillPaintTransformer)) { return false; } if (this.shapeOutlineVisible != that.shapeOutlineVisible) { return false; } if (!PaintUtilities.equal(this.outlinePaint, that.outlinePaint)) { return false; } if (!ObjectUtilities.equal(this.outlineStroke, that.outlineStroke)) { return false; } if (this.shapeAnchor != that.shapeAnchor) { return false; } if (this.shapeLocation != that.shapeLocation) { return false; } if (this.lineVisible != that.lineVisible) { return false; } if (!ShapeUtilities.equal(this.line, that.line)) { return false; } if (!PaintUtilities.equal(this.linePaint, that.linePaint)) { return false; } if (!ObjectUtilities.equal(this.lineStroke, that.lineStroke)) { return false; } return super.equals(obj);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/JFreeChart.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/title/LegendGraphic.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 32 |  | Number of AST nodes: 32

1

    if (obj == this) {↵

1

    if (!(obj instanceof LegendGraphic)) {↵

2

                return true;↵

2

                return false;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof JFreeChart)↵

4

            LegendGraphic that = (LegendGraphic) obj;↵

5

    ) {↵

5

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

6

                return false;↵

6

                return false;↵

7

            }↵

7

            }↵

8

            JFreeChart that = (JFreeChart) obj;↵

8

            ↵

9

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

9

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

10

                return false;↵

10

                return false;↵

11

            }↵

11

            }↵

12

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

12

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

13

                return false;↵

13

                return false;↵

14

            }↵

14

            }↵

15

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

15

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

16

                return false;↵

16

                return false;↵

17

            }↵

17

            }↵

18

            if (!PaintUtilities.equal(this.borderPaint, that.borderPaint↵

18

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

19

    )) {↵

19

                    that.fillPaintTransformer)) {↵

20

                return false;↵

20

                return false;↵

21

            }↵

21

            }↵

22

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

22

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

23

                return false;↵

23

                return false;↵

24

            }↵

24

            }↵

25

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

25

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

26

                return false;↵

26

                return false;↵

27

            }↵

27

            }↵

28

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

28

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

29

                return false;↵

29

                return false;↵

30

            }↵

30

            }↵

31

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

31

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

32

                return false;↵

32

                return false;↵

33

            }↵

33

            }↵

34

            if (!PaintUtilities.equal(↵

34

            if (↵

35

                this.backgroundPaint, that.backgroundPaint↵

36

            )) {↵

35

    this.shapeLocation != that.shapeLocation) {↵

37

                return false;↵

36

                return false;↵

38

            }↵

37

            }↵

39

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

38

            if (↵

40

                    that.backgroundImage)) {↵

39

    this.lineVisible != that.lineVisible) {↵

41

                return false;↵

40

                return false;↵

42

            }↵

41

            }↵

43

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

42

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

44

                return false;↵

43

                return false;↵

45

            }↵

44

            }↵

46

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

45

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

47

                return false;↵

46

                return false;↵

48

            }↵

47

            }↵

49

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

48

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

50

                return false;↵

49

                return false;↵

51

            }↵

50

            }↵

52

            return true;

51

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 20
   Number of unmapped statements in the first code fragment | 9
   Number of unmapped statements in the second code fragment | 9
   Time elapsed for statement mapping (ms) | 5.5
   Clone type | Type 3

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   3

       if (!(obj instanceof JFreeChart))

   3 | if (!(obj instanceof JFreeChart))
   1 | if (!(obj instanceof LegendGraphic))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.JFreeChart | org.jfree.chart.title.LegendGraphic | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof JFreeChart does not match with type boolean of variable obj instanceof LegendGraphic
   - Make classes org.jfree.chart.JFreeChart and org.jfree.chart.title.LegendGraphic extend a common superclass

   1

       if (!(obj instanceof LegendGraphic))

   4

       return false;

   4 | return false;
   2 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   2

       return false;

   3

       LegendGraphic that = (LegendGraphic)obj;

   5

       JFreeChart that = (JFreeChart)obj;

   6

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

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (this.borderVisible != that.borderVisible)

   8 | if (this.borderVisible != that.borderVisible)
   8 | if (this.shapeFilled != that.shapeFilled)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   borderVisible | shapeFilled | VARIABLE_NAME_MISMATCH
   org.jfree.chart.JFreeChart | org.jfree.chart.title.LegendGraphic | VARIABLE_TYPE_MISMATCH
   borderVisible | shapeFilled | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.JFreeChart of variable that does not match with type org.jfree.chart.title.LegendGraphic of variable that
   - Make classes org.jfree.chart.JFreeChart and org.jfree.chart.title.LegendGraphic extend a common superclass

   8

       if (this.shapeFilled != that.shapeFilled)

   9

       return false;

   9 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   10

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

   10 | if (! ObjectUtilities.equal(this.borderStroke, that.borderStroke))
   10 | if (! PaintUtilities.equal(this.fillPaint, that.fillPaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   borderStroke | fillPaint | VARIABLE_NAME_MISMATCH
   java.awt.Stroke | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Stroke of variable this.borderStroke does not match with type java.awt.Paint of variable this.fillPaint
   - Make classes java.awt.Stroke and java.awt.Paint extend a common superclass

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

   10

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

   11

       return false;

   11 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   12

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

   12 | if (! PaintUtilities.equal(this.borderPaint, that.borderPaint))
   12 | if (! ObjectUtilities.equal(this.fillPaintTransformer, that.fillPaintTransformer))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   borderPaint | fillPaintTransformer | VARIABLE_NAME_MISMATCH
   java.awt.Paint | org.jfree.ui.GradientPaintTransformer | VARIABLE_TYPE_MISMATCH
   org.jfree.util.PaintUtilities | org.jfree.util.ObjectUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Paint of variable this.borderPaint does not match with type org.jfree.ui.GradientPaintTransformer of variable this.fillPaintTransformer
   - Make classes java.awt.Paint and org.jfree.ui.GradientPaintTransformer 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

   12

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

   13

       return false;

   13 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   14

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

   15

       return false;

   15 | return false;

   Preondition Violations
   Unmatched return false;

   16

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

   16 | if (! ObjectUtilities.equal(this.title, that.title))
   16 | if (! PaintUtilities.equal(this.outlinePaint, that.outlinePaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   title | outlinePaint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.title.TextTitle | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.title.TextTitle of variable this.title does not match with type java.awt.Paint of variable this.outlinePaint
   - Make classes org.jfree.chart.title.TextTitle and java.awt.Paint extend a common superclass

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

   16

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

   17

       return false;

   17 | return false;
   17 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   17

       return false;

   18

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

   18 | if (! ObjectUtilities.equal(this.subtitles, that.subtitles))
   18 | if (! ObjectUtilities.equal(this.outlineStroke, that.outlineStroke))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   subtitles | outlineStroke | VARIABLE_NAME_MISMATCH
   java.util.List | java.awt.Stroke | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.util.List of variable this.subtitles does not match with type java.awt.Stroke of variable this.outlineStroke
   - Make classes java.util.List and java.awt.Stroke extend a common superclass

   18

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

   19

       return false;

   19 | return false;
   19 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   19

       return false;

   20

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

   20 | if (! ObjectUtilities.equal(this.plot, that.plot))
   26 | if (! ShapeUtilities.equal(this.line, that.line))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   plot | line | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.Plot | java.awt.Shape | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.ShapeUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.Plot of variable this.plot does not match with type java.awt.Shape of variable this.line
   - Make classes org.jfree.chart.plot.Plot and java.awt.Shape extend a common superclass

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

   26

       if (!ShapeUtilities.equal(this.line, that.line))

   21

       return false;

   21 | return false;
   27 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   27

       return false;

   22

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

   22 | if (! PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint))
   6 | if (! ShapeUtilities.equal(this.shape, that.shape))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   backgroundPaint | shape | VARIABLE_NAME_MISMATCH
   java.awt.Paint | java.awt.Shape | VARIABLE_TYPE_MISMATCH
   org.jfree.util.PaintUtilities | org.jfree.util.ShapeUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Paint of variable this.backgroundPaint does not match with type java.awt.Shape of variable this.shape
   - Make classes java.awt.Paint and java.awt.Shape extend a common superclass

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

   6

       if (!ShapeUtilities.equal(this.shape, that.shape))

   23

       return false;

   23 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   14

       if (this.shapeOutlineVisible != that.shapeOutlineVisible)

   15 | return false;

   Preondition Violations
   Unmatched return false;

   15

       return false;

   20

       if (this.shapeAnchor != that.shapeAnchor)

   21 | return false;

   Preondition Violations
   Unmatched return false;

   21

       return false;

   22

       if (this.shapeLocation != that.shapeLocation)

   23 | return false;

   Preondition Violations
   Unmatched return false;

   23

       return false;

   24

       if (this.lineVisible != that.lineVisible)

   25 | return false;

   Preondition Violations
   Unmatched return false;

   25

       return false;

   24

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

   24 | if (! ObjectUtilities.equal(this.backgroundImage, that.backgroundImage))
   28 | if (! PaintUtilities.equal(this.linePaint, that.linePaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   backgroundImage | linePaint | VARIABLE_NAME_MISMATCH
   java.awt.Image | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Image of variable this.backgroundImage does not match with type java.awt.Paint of variable this.linePaint
   - Make classes java.awt.Image and java.awt.Paint extend a common superclass

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

   28

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

   25

       return false;

   25 | return false;
   29 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   29

       return false;

   26

       if (this.backgroundImageAlignment != that.backgroundImageAlignment)

   27

       return false;

   27 | return false;

   Preondition Violations
   Unmatched return false;

   28

       if (this.backgroundImageAlpha != that.backgroundImageAlpha)

   29

       return false;

   29 | return false;

   Preondition Violations
   Unmatched return false;

   30

       if (this.notify != that.notify)

   30 | if (this.notify != that.notify)
   4 | if (this.shapeVisible != that.shapeVisible)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   notify | shapeVisible | VARIABLE_NAME_MISMATCH
   org.jfree.chart.JFreeChart | org.jfree.chart.title.LegendGraphic | VARIABLE_TYPE_MISMATCH
   notify | shapeVisible | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.JFreeChart of variable that does not match with type org.jfree.chart.title.LegendGraphic of variable that
   - Make classes org.jfree.chart.JFreeChart and org.jfree.chart.title.LegendGraphic extend a common superclass

   4

       if (this.shapeVisible != that.shapeVisible)

   31

       return false;

   31 | return false;
   5 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   5

       return false;

   Precondition Violations (44)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof JFreeChart does not match with type boolean of variable obj instanceof LegendGraphic
   2 | Unmatched return false;
   3 | Type org.jfree.chart.JFreeChart of variable that does not match with type org.jfree.chart.title.LegendGraphic of variable that
   4 | Type java.awt.Stroke of variable this.borderStroke does not match with type java.awt.Paint of variable this.fillPaint
   5 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   6 | Type java.awt.Paint of variable this.borderPaint does not match with type org.jfree.ui.GradientPaintTransformer of variable this.fillPaintTransformer
   7 | Type org.jfree.util.PaintUtilities of variable PaintUtilities does not match with type org.jfree.util.ObjectUtilities of variable ObjectUtilities
   8 | Unmatched return false;
   9 | Type org.jfree.chart.title.TextTitle of variable this.title does not match with type java.awt.Paint of variable this.outlinePaint
   10 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   11 | Type java.util.List of variable this.subtitles does not match with type java.awt.Stroke of variable this.outlineStroke
   12 | Type org.jfree.chart.plot.Plot of variable this.plot does not match with type java.awt.Shape of variable this.line
   13 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.ShapeUtilities of variable ShapeUtilities
   14 | Type java.awt.Paint of variable this.backgroundPaint does not match with type java.awt.Shape of variable this.shape
   15 | Type org.jfree.util.PaintUtilities of variable PaintUtilities does not match with type org.jfree.util.ShapeUtilities of variable ShapeUtilities
   16 | Unmatched return false;
   17 | Unmatched return false;
   18 | Unmatched return false;
   19 | Unmatched return false;
   20 | Type java.awt.Image of variable this.backgroundImage does not match with type java.awt.Paint of variable this.linePaint
   21 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   22 | Unmatched return false;
   23 | Unmatched return false;
   24 | Type org.jfree.chart.JFreeChart of variable that does not match with type org.jfree.chart.title.LegendGraphic of variable that
   25 | Conditional return false;
   26 | Conditional return false;
   27 | Conditional return false;
   28 | Conditional return false;
   29 | Conditional return false;
   30 | Conditional return false;
   31 | Conditional return false;
   32 | Conditional return false;
   33 | Conditional return false;
   34 | Conditional return false;
   35 | Conditional return false;
   36 | Conditional return false;
   37 | Conditional return false;
   38 | Conditional return false;
   39 | Conditional return false;
   40 | Conditional return false;
   41 | Conditional return false;
   42 | Conditional return false;
   43 | Conditional return false;
   44 | Conditional return false;