43-122-149

if (obj == this) { return true; } if (!(obj instanceof StackedBarRenderer)) { return false; } StackedBarRenderer that = (StackedBarRenderer) obj; if (this.renderAsPercentages != that.renderAsPercentages) { return false; } return super.equals(obj);
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/renderer/category/StackedBarRenderer.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: 8 |  | 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 StackedBarRenderer↵

4

            if (!(obj instanceof Title)) {↵

5

                return false;↵

6

            }↵

5

    )) {↵

7

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

6

                return false;↵

8

                return false;   ↵

7

            }↵

9

            }↵

8

            StackedBarRenderer that = (StackedBarRenderer) obj;↵

10

            ↵

9

            if (this.renderAsPercentages != that.renderAsPercentages↵

11

    Title that = (Title) obj;↵

12

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

13

                return false;↵

14

            }↵

15

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

16

                return false;↵

17

            }↵

10

    ) {↵

18

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

11

                return false;↵

19

                return false;↵

12

            }↵

20

            }↵

13

            return super.equals(obj)↵

21

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

22

                return false;↵

23

            }↵

14

    ;

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) | 0.8
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 | 1
   Number of unmapped statements in the second code fragment | 9
   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;

   3

       if (!(obj instanceof StackedBarRenderer))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.category.StackedBarRenderer | org.jfree.chart.title.Title | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof Title))

   4

       return false;

   4

       return false;

   5

       if (!super.equals(obj))

   6 | return false;

   Preondition Violations
   Unmatched return false;

   6

       return false;

   5

       StackedBarRenderer that = (StackedBarRenderer)obj;

   7

       Title that = (Title)obj;

   8

       if (this.position != that.position)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

       if (this.horizontalAlignment != that.horizontalAlignment)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   12

       if (this.verticalAlignment != that.verticalAlignment)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   6

       if (this.renderAsPercentages != that.renderAsPercentages)

   6 | if (this.renderAsPercentages != that.renderAsPercentages)
   14 | if (this.notify != that.notify)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   renderAsPercentages | notify | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.category.StackedBarRenderer | org.jfree.chart.title.Title | VARIABLE_TYPE_MISMATCH
   renderAsPercentages | notify | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.category.StackedBarRenderer of variable that does not match with type org.jfree.chart.title.Title of variable that
   - Make classes org.jfree.chart.renderer.category.StackedBarRenderer and org.jfree.chart.title.Title extend a common superclass

   14

       if (this.notify != that.notify)

   7

       return false;

   15

       return false;

   8

       return super.equals(obj);

   8 | return super.equals(obj);
   16 | return true;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   super.equals(obj) | true | TYPE_COMPATIBLE_REPLACEMENT

   16

       return true;

   Precondition Violations (6)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof StackedBarRenderer does not match with type boolean of variable obj instanceof Title
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Type org.jfree.chart.renderer.category.StackedBarRenderer of variable that does not match with type org.jfree.chart.title.Title of variable that