43-132-150

if (obj == this) { return true; } if (!(obj instanceof ClusteredXYBarRenderer)) { return false; } ClusteredXYBarRenderer that = (ClusteredXYBarRenderer) obj; if (this.centerBarAtStartValue != that.centerBarAtStartValue) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!(obj instanceof XYSeries)) { return false; } if (!super.equals(obj)) { return false; } XYSeries that = (XYSeries) obj; if (this.maximumItemCount != that.maximumItemCount) { return false; } if (this.autoSort != that.autoSort) { return false; } if (this.allowDuplicateXValues != that.allowDuplicateXValues) { return false; } if (!ObjectUtilities.equal(this.data, that.data)) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/ClusteredXYBarRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/XYSeries.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 ClusteredXYBarRenderer)) {↵

4

            if (!(obj instanceof XYSeries)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            ClusteredXYBarRenderer that = (ClusteredXYBarRenderer) obj;↵

7

            ↵

8

            if (this.centerBarAtStart↵

8

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

9

                return false;↵

10

            }↵

11

            XYSeries that = (XYSeries) obj;↵

12

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

13

                return false;↵

14

            }↵

15

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

16

                return false;↵

17

            }↵

9

    Value != that.centerBarAtStartValue↵

18

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

19

                return false;↵

20

            }↵

10

    ) {↵

21

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

11

                return false;↵

22

                return false;↵

12

            }↵

23

            }↵

13

            return super.equals(obj);

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

   3 | if (!(obj instanceof ClusteredXYBarRenderer))
   3 | if (!(obj instanceof XYSeries))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.renderer.xy.ClusteredXYBarRenderer | org.jfree.data.xy.XYSeries | VARIABLE_TYPE_MISMATCH

   Preondition Violations

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

   3

       if (!(obj instanceof XYSeries))

   4

       return false;

   4

       return false;

   5

       if (!super.equals(obj))

   6 | return false;

   Preondition Violations
   Unmatched return false;

   6

       return false;

   5

       ClusteredXYBarRenderer that = (ClusteredXYBarRenderer)obj;

   7

       XYSeries that = (XYSeries)obj;

   8

       if (this.maximumItemCount != that.maximumItemCount)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   6

       if (this.centerBarAtStartValue != that.centerBarAtStartValue)

   6 | if (this.centerBarAtStartValue != that.centerBarAtStartValue)
   10 | if (this.autoSort != that.autoSort)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   centerBarAtStartValue | autoSort | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.ClusteredXYBarRenderer | org.jfree.data.xy.XYSeries | VARIABLE_TYPE_MISMATCH
   centerBarAtStartValue | autoSort | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.xy.ClusteredXYBarRenderer of variable that does not match with type org.jfree.data.xy.XYSeries of variable that
   - Make classes org.jfree.chart.renderer.xy.ClusteredXYBarRenderer and org.jfree.data.xy.XYSeries extend a common superclass

   10

       if (this.autoSort != that.autoSort)

   7

       return false;

   11

       return false;

   12

       if (this.allowDuplicateXValues != that.allowDuplicateXValues)

   13 | return false;

   Preondition Violations
   Unmatched return false;

   13

       return false;

   14

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

   15 | return false;

   Preondition Violations
   Unmatched 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 ClusteredXYBarRenderer does not match with type boolean of variable obj instanceof XYSeries
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Type org.jfree.chart.renderer.xy.ClusteredXYBarRenderer of variable that does not match with type org.jfree.data.xy.XYSeries of variable that
   5 | Unmatched return false;
   6 | Unmatched return false;