43-140-149

if (obj == this) { return true; } if (!(obj instanceof CombinedDomainCategoryPlot)) { return false; } if (!super.equals(obj)) { return false; } CombinedDomainCategoryPlot plot = (CombinedDomainCategoryPlot) obj; if (!ObjectUtilities.equal(this.subplots, plot.subplots)) { return false; } if (this.totalWeight != plot.totalWeight) { return false; } if (this.gap != plot.gap) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof Title)) { return false; } if (!super.equals(obj)) { return false; } Title that = (Title) obj; if (this.position != that.position) { return false; } if (this.horizontalAlignment != that.horizontalAlignment) { return false; } if (this.verticalAlignment != that.verticalAlignment) { return false; } if (this.notify != that.notify) { return false; } return true;

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

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof CombinedDomainCategoryPlot)) {↵

4

            if (!(obj instanceof Title)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

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

7

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

8

                return false;↵

8

                return false;   ↵

9

            }↵

9

            }↵

10

            CombinedDomainCategoryPlot plot = (CombinedDomainCategoryPlot) obj;↵

10

            ↵

11

            if (!ObjectUtilities.equal(this.subplots, plot.subplots)↵

11

    Title that = (Title) obj;↵

12

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

13

                return false;↵

14

            }↵

12

    ) {↵

15

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

13

                return false;↵

16

                return false;↵

14

            }↵

17

            }↵

15

            if (this.totalWeight != plot.totalWeight) {↵

18

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

16

                return false;↵

19

                return false;↵

17

            }↵

20

            }↵

18

            if (this.gap != plot.gap) {↵

21

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

19

                return false;↵

22

                return false;↵

20

            }↵

23

            }↵

21

            return true;

24

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 6
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 0
   Time elapsed for statement mapping (ms) | 0.5
   Clone type | Type 2

   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 CombinedDomainCategoryPlot))

   3 | if (!(obj instanceof CombinedDomainCategoryPlot))
   3 | if (!(obj instanceof Title))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedDomainCategoryPlot | org.jfree.chart.title.Title | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof Title))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       if (!super.equals(obj))

   5

       if (!super.equals(obj))

   6

       return false;

   6 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   Precondition Violations (7)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof CombinedDomainCategoryPlot does not match with type boolean of variable obj instanceof Title
   2 | Conditional return true;
   3 | Conditional return true;
   4 | Conditional return false;
   5 | Conditional return false;
   6 | Conditional return false;
   7 | Conditional return false;