129-4-5

if (obj == this) { return true; } if (!(obj instanceof StandardXYItemRenderer)) { return false; } StandardXYItemRenderer that = (StandardXYItemRenderer) obj; if (this.baseShapesVisible != that.baseShapesVisible) { return false; } if (this.plotLines != that.plotLines) { return false; } if (this.plotImages != that.plotImages) { return false; } if (this.plotDiscontinuous != that.plotDiscontinuous) { return false; } if (this.gapThresholdType != that.gapThresholdType) { return false; } if (this.gapThreshold != that.gapThreshold) { return false; } if (!ObjectUtilities.equal(this.shapesFilled, that.shapesFilled)) { return false; } if (!this.seriesShapesFilled.equals(that.seriesShapesFilled)) { return false; } if (this.baseShapesFilled != that.baseShapesFilled) { return false; } if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath) { return false; } if (!ShapeUtilities.equal(this.legendLine, that.legendLine)) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof TextTitle)) { return false; } TextTitle that = (TextTitle) obj; if (!ObjectUtilities.equal(this.text, that.text)) { return false; } if (!ObjectUtilities.equal(this.font, that.font)) { return false; } if (!PaintUtilities.equal(this.paint, that.paint)) { return false; } if (this.textAlignment != that.textAlignment) { return false; } if (!PaintUtilities.equal(this.backgroundPaint, that.backgroundPaint)) { return false; } if (this.maximumLinesToDisplay != that.maximumLinesToDisplay) { return false; } if (this.expandToFitSpace != that.expandToFitSpace) { return false; } if (!ObjectUtilities.equal(this.toolTipText, that.toolTipText)) { return false; } if (!ObjectUtilities.equal(this.urlText, that.urlText)) { return false; } return super.equals(obj);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/StandardXYItemRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/title/TextTitle.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 28 |  | Number of AST nodes: 24

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof StandardXYItemRenderer)) {↵

4

            if (!(obj instanceof TextTitle)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            StandardXYItemRenderer that = (StandardXYItemRenderer) obj;↵

7

            ↵

8

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

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

14

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

15

                return false;↵

16

            }↵

17

            if (this.plotDiscontinuous != that.plotDiscontinuous↵

8

    TextTitle that = (TextTitle) obj;↵

9

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

10

                return false;↵

11

            }↵

18

    ) {↵

12

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

19

                return false;↵

13

                return false;↵

20

            }↵

14

            }↵

21

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

15

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

22

                return false;↵

16

                return false;↵

23

            }↵

17

            }↵

24

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

18

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

25

                return false;↵

19

                return false;↵

26

            }↵

20

            }↵

27

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

21

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

28

                return false;↵

22

                return false;↵

29

            }↵

23

            }↵

30

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

24

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

31

                return false;↵

25

                return false;↵

32

            }↵

26

            }↵

33

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

27

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

34

                return false;↵

28

                return false;↵

35

            }↵

29

            }↵

36

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

30

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

37

                return false;↵

31

                return false;↵

38

            }↵

32

            }↵

39

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

33

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

40

                return false;↵

34

                return false;↵

41

            }↵

35

            }↵

42

            return super.equals(obj);

36

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 10
   Number of unmapped statements in the first code fragment | 17
   Number of unmapped statements in the second code fragment | 9
   Time elapsed for statement mapping (ms) | 2.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;
   2 | return true;

   Preondition Violations
   Conditional return true;
   Conditional return true;

   2

       return true;

   3

       if (!(obj instanceof StandardXYItemRenderer))

   3 | if (!(obj instanceof StandardXYItemRenderer))
   3 | if (!(obj instanceof TextTitle))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.StandardXYItemRenderer | org.jfree.chart.title.TextTitle | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof TextTitle))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       TextTitle that = (TextTitle)obj;

   5

       StandardXYItemRenderer that = (StandardXYItemRenderer)obj;

   10

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

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   12

       if (this.textAlignment != that.textAlignment)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   14

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

   15 | return false;

   Preondition Violations
   Unmatched return false;

   15

       return false;

   16

       if (this.maximumLinesToDisplay != that.maximumLinesToDisplay)

   17 | return false;

   Preondition Violations
   Unmatched return false;

   17

       return false;

   6

       if (this.baseShapesVisible != that.baseShapesVisible)

   6 | if (this.baseShapesVisible != that.baseShapesVisible)
   18 | if (this.expandToFitSpace != that.expandToFitSpace)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   baseShapesVisible | expandToFitSpace | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.StandardXYItemRenderer | org.jfree.chart.title.TextTitle | VARIABLE_TYPE_MISMATCH
   baseShapesVisible | expandToFitSpace | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.xy.StandardXYItemRenderer of variable that does not match with type org.jfree.chart.title.TextTitle of variable that
   - Make classes org.jfree.chart.renderer.xy.StandardXYItemRenderer and org.jfree.chart.title.TextTitle extend a common superclass

   18

       if (this.expandToFitSpace != that.expandToFitSpace)

   7

       return false;

   7 | return false;
   19 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   19

       return false;

   8

       if (this.plotLines != that.plotLines)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.plotImages != that.plotImages)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.plotDiscontinuous != that.plotDiscontinuous)

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (this.gapThresholdType != that.gapThresholdType)

   15

       return false;

   15 | return false;

   Preondition Violations
   Unmatched return false;

   16

       if (this.gapThreshold != that.gapThreshold)

   17

       return false;

   17 | return false;

   Preondition Violations
   Unmatched return false;

   18

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

   18 | if (! ObjectUtilities.equal(this.shapesFilled, that.shapesFilled))
   8 | if (! ObjectUtilities.equal(this.font, that.font))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   shapesFilled | font | VARIABLE_NAME_MISMATCH
   java.lang.Boolean | java.awt.Font | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.lang.Boolean of variable this.shapesFilled does not match with type java.awt.Font of variable this.font
   - Make classes java.lang.Boolean and java.awt.Font extend a common superclass

   8

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

   19

       return false;

   19 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   20

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

   21

       return false;

   21 | return false;

   Preondition Violations
   Unmatched return false;

   22

       if (this.baseShapesFilled != that.baseShapesFilled)

   23

       return false;

   23 | return false;

   Preondition Violations
   Unmatched return false;

   24

       if (this.drawSeriesLineAsPath != that.drawSeriesLineAsPath)

   25

       return false;

   25 | return false;

   Preondition Violations
   Unmatched return false;

   26

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

   26 | if (! ShapeUtilities.equal(this.legendLine, that.legendLine))
   6 | if (! ObjectUtilities.equal(this.text, that.text))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   legendLine | text | VARIABLE_NAME_MISMATCH
   java.awt.Shape | java.lang.String | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ShapeUtilities | org.jfree.util.ObjectUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Shape of variable this.legendLine does not match with type java.lang.String of variable this.text
   - Make classes java.awt.Shape and java.lang.String extend a common superclass

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

   6

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

   27

       return false;

   27 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   Precondition Violations (27)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof StandardXYItemRenderer does not match with type boolean of variable obj instanceof TextTitle
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Type org.jfree.chart.renderer.xy.StandardXYItemRenderer of variable that does not match with type org.jfree.chart.title.TextTitle of variable that
   7 | Unmatched return false;
   8 | Unmatched return false;
   9 | Unmatched return false;
   10 | Unmatched return false;
   11 | Unmatched return false;
   12 | Type java.lang.Boolean of variable this.shapesFilled does not match with type java.awt.Font of variable this.font
   13 | Unmatched return false;
   14 | Unmatched return false;
   15 | Unmatched return false;
   16 | Type java.awt.Shape of variable this.legendLine does not match with type java.lang.String of variable this.text
   17 | Type org.jfree.util.ShapeUtilities of variable ShapeUtilities does not match with type org.jfree.util.ObjectUtilities of variable ObjectUtilities
   18 | Conditional return true;
   19 | Conditional return true;
   20 | Conditional return false;
   21 | Conditional return false;
   22 | Conditional return false;
   23 | Conditional return false;
   24 | Conditional return false;
   25 | Conditional return false;
   26 | Conditional return false;
   27 | Conditional return false;