43-13-37

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 SlidingGanttCategoryDataset)) { return false; } SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) obj; if (this.firstCategoryIndex != that.firstCategoryIndex) { return false; } if (this.maximumCategoryCount != that.maximumCategoryCount) { return false; } if (!this.underlying.equals(that.underlying)) { 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/data/gantt/SlidingGanttCategoryDataset.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | Number of AST nodes: 12

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

    			return true;↵

3

            }↵

4

            ↵

3

    		}↵

5

    if (!(obj instanceof MeterInterval)) {↵

4

    		if (!(obj instanceof ↵

6

                return false;↵

7

            }↵

8

            MeterInterval that = (MeterInterval) obj;↵

9

            ↵

5

    SlidingGanttCategoryDataset)) {↵

6

    			return false;↵

7

    		}↵

8

    		SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset) obj;↵

10

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

9

    		if (this.↵

11

                return false;↵

12

            }↵

13

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

14

                return false;↵

15

            }↵

16

            if (!PaintUtilities.equal(this.outlinePaint, that.outlinePai↵

10

    firstCategoryIndex != that.firstCategoryIndex) {↵

11

    			return false;↵

12

    		}↵

17

    nt)) {↵

13

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

18

                return false;↵

14

    			return false;↵

19

            }↵

20

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

21

                return false;↵

22

            }↵

23

            if (!PaintUtilities↵

15

    		}↵

24

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

16

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

25

                return false;↵

17

    			return false;↵

26

            }↵

27

            ↵

18

    		}↵

28

    return true;

19

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

1. {Non-refactorable}

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

   3 | if (!(obj instanceof MeterInterval))
   3 | if (!(obj instanceof SlidingGanttCategoryDataset))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MeterInterval | org.jfree.data.gantt.SlidingGanttCategoryDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof SlidingGanttCategoryDataset))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       SlidingGanttCategoryDataset that = (SlidingGanttCategoryDataset)obj;

   5

       MeterInterval that = (MeterInterval)obj;

   6

       if (this.firstCategoryIndex != that.firstCategoryIndex)

   7 | return false;

   Preondition Violations
   Unmatched return false;

   7

       return false;

   8

       if (this.maximumCategoryCount != that.maximumCategoryCount)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   6

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

   6 | if (! this.label.equals(that.label))
   10 | if (! this.underlying.equals(that.underlying))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.MeterInterval | org.jfree.data.gantt.SlidingGanttCategoryDataset | VARIABLE_TYPE_MISMATCH
   label | underlying | VARIABLE_NAME_MISMATCH
   java.lang.String | org.jfree.data.gantt.GanttCategoryDataset | VARIABLE_TYPE_MISMATCH
   label | underlying | VARIABLE_NAME_MISMATCH
   java.lang.String | org.jfree.data.gantt.GanttCategoryDataset | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   Type java.lang.String of variable that.label does not match with type org.jfree.data.gantt.GanttCategoryDataset of variable that.underlying
   - Make classes java.lang.String and org.jfree.data.gantt.GanttCategoryDataset extend a common superclass

   Type java.lang.String of variable this.label does not match with type org.jfree.data.gantt.GanttCategoryDataset of variable this.underlying
   - Make classes java.lang.String and org.jfree.data.gantt.GanttCategoryDataset extend a common superclass

   10

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

   7

       return false;

   7 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   Precondition Violations (12)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof MeterInterval does not match with type boolean of variable obj instanceof SlidingGanttCategoryDataset
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Type org.jfree.chart.plot.MeterInterval of variable that does not match with type org.jfree.data.gantt.SlidingGanttCategoryDataset of variable that
   5 | Type java.lang.String of variable that.label does not match with type org.jfree.data.gantt.GanttCategoryDataset of variable that.underlying
   6 | Type java.lang.String of variable this.label does not match with type org.jfree.data.gantt.GanttCategoryDataset of variable this.underlying
   7 | Conditional return true;
   8 | Conditional return true;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;