43-13-109

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 StandardCategorySeriesLabelGenerator)) { return false; } StandardCategorySeriesLabelGenerator that = (StandardCategorySeriesLabelGenerator) obj; if (!this.formatPattern.equals(that.formatPattern)) { return false; } return true;

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/labels/StandardCategorySeriesLabelGenerator.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | Number of AST nodes: 8

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 ↵

5

                return false;↵

6

            }↵

7

            MeterInterval that = (MeterInterval) obj;↵

8

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

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

14

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

15

                return false;↵

16

            }↵

17

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

18

                return false;↵

19

            }↵

20

            if (!PaintUtilities↵

5

    StandardCategorySeriesLabelGenerator)) {↵

6

                return false;↵

7

            }↵

8

            StandardCategorySeriesLabelGenerator that ↵

9

                    = (StandardCategorySeriesLabelGenerator) obj;↵

21

    .equal(this.backgroundPaint, that.backgroundPaint)) {↵

10

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

22

                return false;↵

11

                return false;↵

23

            }↵

12

            }↵

24

            return true;

13

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 7
   Number of unmapped statements in the first code fragment | 9
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 0.8
   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 StandardCategorySeriesLabelGenerator))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MeterInterval | org.jfree.chart.labels.StandardCategorySeriesLabelGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof StandardCategorySeriesLabelGenerator))

   4

       return false;

   4

       return false;

   5

       StandardCategorySeriesLabelGenerator that = (StandardCategorySeriesLabelGenerator)obj;

   5

       MeterInterval that = (MeterInterval)obj;

   6

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MeterInterval | org.jfree.chart.labels.StandardCategorySeriesLabelGenerator | VARIABLE_TYPE_MISMATCH
   label | formatPattern | VARIABLE_NAME_MISMATCH
   label | formatPattern | VARIABLE_NAME_MISMATCH

   Preondition Violations

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

   6

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

   7

       return false;

   7

       return false;

   8

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

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

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

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched 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;

   8

       return true;

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof MeterInterval does not match with type boolean of variable obj instanceof StandardCategorySeriesLabelGenerator
   2 | Type org.jfree.chart.plot.MeterInterval of variable that does not match with type org.jfree.chart.labels.StandardCategorySeriesLabelGenerator of variable that
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Unmatched return false;