43-151-155

if (obj == this) { return true; } if (!(obj instanceof ComparableObjectSeries)) { return false; } if (!super.equals(obj)) { return false; } ComparableObjectSeries that = (ComparableObjectSeries) 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;
if (obj == this) { return true; } if (!(obj instanceof CyclicNumberAxis)) { return false; } if (!super.equals(obj)) { return false; } CyclicNumberAxis that = (CyclicNumberAxis) obj; if (this.period != that.period) { return false; } if (this.offset != that.offset) { return false; } if (!PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint)) { return false; } if (!ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke)) { return false; } if (this.advanceLineVisible != that.advanceLineVisible) { return false; } if (this.boundMappedToLastCycle != that.boundMappedToLastCycle) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/ComparableObjectSeries.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/axis/CyclicNumberAxis.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 16 |  | Number of AST nodes: 20

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof ComparableObjectSeries)) {↵

4

            if (!(obj instanceof CyclicNumberAxis)) {↵

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

            ComparableObjectSeries that = (ComparableObjectSeries) obj;↵

10

            CyclicNumberAxis that = (CyclicNumberAxis) obj;      ↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

            if (this.allowDuplicateXValues != that.allowDuplicateXValues↵

17

            if (!PaintUtilities.equal(this.advanceLinePaint, ↵

18

    ) {↵

18

                    that.advanceLinePaint)) {↵

19

                return false;↵

19

                return false;↵

20

            }↵

20

            }↵

21

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

21

            if (!ObjectUtilities.equal(this.advanceLineStroke, ↵

22

                    that.advanceLineStroke)) {↵

23

                return false;↵

24

            }↵

25

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

26

                return false;↵

27

            }↵

22

    ) {↵

28

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

23

                return false;↵

29

                return false;↵

24

            }↵

30

            }↵

25

            return true;

31

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 12
   Number of unmapped statements in the first code fragment | 3
   Number of unmapped statements in the second code fragment | 7
   Time elapsed for statement mapping (ms) | 1.4
   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 ComparableObjectSeries))

   3 | if (!(obj instanceof ComparableObjectSeries))
   3 | if (!(obj instanceof CyclicNumberAxis))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.ComparableObjectSeries | org.jfree.chart.axis.CyclicNumberAxis | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof ComparableObjectSeries does not match with type boolean of variable obj instanceof CyclicNumberAxis
   - Make classes org.jfree.data.ComparableObjectSeries and org.jfree.chart.axis.CyclicNumberAxis extend a common superclass

   3

       if (!(obj instanceof CyclicNumberAxis))

   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;

   7

       CyclicNumberAxis that = (CyclicNumberAxis)obj;

   7

       ComparableObjectSeries that = (ComparableObjectSeries)obj;

   8

       if (this.period != that.period)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   8

       if (this.maximumItemCount != that.maximumItemCount)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       if (this.offset != that.offset)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   14

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

   15 | return false;

   Preondition Violations
   Unmatched return false;

   15

       return false;

   10

       if (this.autoSort != that.autoSort)

   10 | if (this.autoSort != that.autoSort)
   16 | if (this.advanceLineVisible != that.advanceLineVisible)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   autoSort | advanceLineVisible | VARIABLE_NAME_MISMATCH
   org.jfree.data.ComparableObjectSeries | org.jfree.chart.axis.CyclicNumberAxis | VARIABLE_TYPE_MISMATCH
   autoSort | advanceLineVisible | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.data.ComparableObjectSeries of variable that does not match with type org.jfree.chart.axis.CyclicNumberAxis of variable that
   - Make classes org.jfree.data.ComparableObjectSeries and org.jfree.chart.axis.CyclicNumberAxis extend a common superclass

   16

       if (this.advanceLineVisible != that.advanceLineVisible)

   11

       return false;

   11 | return false;
   17 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   17

       return false;

   12

       if (this.allowDuplicateXValues != that.allowDuplicateXValues)

   12 | if (this.allowDuplicateXValues != that.allowDuplicateXValues)
   18 | if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   allowDuplicateXValues | boundMappedToLastCycle | VARIABLE_NAME_MISMATCH
   org.jfree.data.ComparableObjectSeries | org.jfree.chart.axis.CyclicNumberAxis | VARIABLE_TYPE_MISMATCH
   allowDuplicateXValues | boundMappedToLastCycle | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.data.ComparableObjectSeries of variable that does not match with type org.jfree.chart.axis.CyclicNumberAxis of variable that
   - Make classes org.jfree.data.ComparableObjectSeries and org.jfree.chart.axis.CyclicNumberAxis extend a common superclass

   18

       if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)

   13

       return false;

   13 | return false;
   19 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   19

       return false;

   14

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

   14 | if (! ObjectUtilities.equal(this.data, that.data))
   12 | if (! PaintUtilities.equal(this.advanceLinePaint, that.advanceLinePaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   data | advanceLinePaint | VARIABLE_NAME_MISMATCH
   java.util.List | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.util.List of variable this.data does not match with type java.awt.Paint of variable this.advanceLinePaint
   - Make classes java.util.List and java.awt.Paint extend a common superclass

   Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   - Make classes org.jfree.util.ObjectUtilities and org.jfree.util.PaintUtilities extend a common superclass

   12

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

   15

       return false;

   15 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   Precondition Violations (21)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof ComparableObjectSeries does not match with type boolean of variable obj instanceof CyclicNumberAxis
   2 | Unmatched return false;
   3 | Unmatched return false;
   4 | Unmatched return false;
   5 | Unmatched return false;
   6 | Type org.jfree.data.ComparableObjectSeries of variable that does not match with type org.jfree.chart.axis.CyclicNumberAxis of variable that
   7 | Type org.jfree.data.ComparableObjectSeries of variable that does not match with type org.jfree.chart.axis.CyclicNumberAxis of variable that
   8 | Type java.util.List of variable this.data does not match with type java.awt.Paint of variable this.advanceLinePaint
   9 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   10 | Conditional return true;
   11 | Conditional return true;
   12 | Conditional return false;
   13 | Conditional return false;
   14 | Conditional return false;
   15 | Conditional return false;
   16 | Conditional return false;
   17 | Conditional return false;
   18 | Conditional return false;
   19 | Conditional return false;
   20 | Conditional return false;
   21 | Conditional return false;