43-153-155

if (obj == this) { return true; } if (!(obj instanceof NumberAxis)) { return false; } if (!super.equals(obj)) { return false; } NumberAxis that = (NumberAxis) obj; if (this.autoRangeIncludesZero != that.autoRangeIncludesZero) { return false; } if (this.autoRangeStickyZero != that.autoRangeStickyZero) { return false; } if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride)) { return false; } if (!this.rangeType.equals(that.rangeType)) { 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/chart/axis/NumberAxis.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: 18 |  | 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 NumberAxis)) {↵

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

            NumberAxis that = (NumberAxis) obj;↵

10

            CyclicNumberAxis that = (CyclicNumberAxis) obj;      ↵

11

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

11

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

12

                return false;↵

12

                return false;↵

13

            }↵

13

            }↵

14

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

14

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

15

                return false;↵

15

                return false;↵

16

            }↵

16

            }↵

17

            if (!ObjectUtilities.equal(this.tickUnit, that.tickUni↵

17

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

18

    t)) {↵

18

                    that.advanceLinePaint)) {↵

19

                return false;↵

19

                return false;↵

20

            }↵

20

            }↵

21

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

21

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

22

                    that.advanceLineStroke)) {↵

23

                return false;↵

22

            ↵

24

            }↵

23

            that.numberFormatOverride)) {↵

25

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

24

                return false;↵

26

                return false;↵

25

            }↵

27

            }↵

26

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

28

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

27

                return false;↵

29

                return false;↵

28

            }↵

30

            }↵

29

            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.7
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 157

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 15
   Number of unmapped statements in the first code fragment | 0
   Number of unmapped statements in the second code fragment | 4
   Time elapsed for statement mapping (ms) | 2.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 NumberAxis))

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.NumberAxis | org.jfree.chart.axis.CyclicNumberAxis | SUBCLASS_TYPE_MISMATCH

   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

       NumberAxis that = (NumberAxis)obj;

   7 | NumberAxis that = (NumberAxis)obj;
   7 | CyclicNumberAxis that = (CyclicNumberAxis)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.NumberAxis | org.jfree.chart.axis.CyclicNumberAxis | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.axis.NumberAxis | org.jfree.chart.axis.CyclicNumberAxis | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.axis.NumberAxis | org.jfree.chart.axis.CyclicNumberAxis | SUBCLASS_TYPE_MISMATCH

   7

       CyclicNumberAxis that = (CyclicNumberAxis)obj;

   8

       if (this.period != that.period)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   10

       if (this.offset != that.offset)

   11 | return false;

   Preondition Violations
   Unmatched return false;

   11

       return false;

   8

       if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)

   8 | if (this.autoRangeIncludesZero != that.autoRangeIncludesZero)
   16 | if (this.advanceLineVisible != that.advanceLineVisible)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   autoRangeIncludesZero | advanceLineVisible | VARIABLE_NAME_MISMATCH
   org.jfree.chart.axis.NumberAxis | org.jfree.chart.axis.CyclicNumberAxis | SUBCLASS_TYPE_MISMATCH
   autoRangeIncludesZero | advanceLineVisible | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression that.autoRangeIncludesZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression that.advanceLineVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted

   16

       if (this.advanceLineVisible != that.advanceLineVisible)

   9

       return false;

   9 | return false;
   17 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   17

       return false;

   10

       if (this.autoRangeStickyZero != that.autoRangeStickyZero)

   10 | if (this.autoRangeStickyZero != that.autoRangeStickyZero)
   18 | if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   autoRangeStickyZero | boundMappedToLastCycle | VARIABLE_NAME_MISMATCH
   org.jfree.chart.axis.NumberAxis | org.jfree.chart.axis.CyclicNumberAxis | SUBCLASS_TYPE_MISMATCH
   autoRangeStickyZero | boundMappedToLastCycle | VARIABLE_NAME_MISMATCH

   Preondition Violations
   Expression that.autoRangeStickyZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression that.boundMappedToLastCycle cannot be parameterized, because it has dependencies to/from statements that will be extracted

   18

       if (this.boundMappedToLastCycle != that.boundMappedToLastCycle)

   11

       return false;

   11 | return false;
   19 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   19

       return false;

   12

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

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

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   tickUnit | advanceLinePaint | VARIABLE_NAME_MISMATCH
   org.jfree.chart.axis.NumberTickUnit | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.advanceLinePaint
   - Make classes org.jfree.chart.axis.NumberTickUnit 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))

   13

       return false;

   13 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   14

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

   14 | if (! ObjectUtilities.equal(this.numberFormatOverride, that.numberFormatOverride))
   14 | if (! ObjectUtilities.equal(this.advanceLineStroke, that.advanceLineStroke))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   numberFormatOverride | advanceLineStroke | VARIABLE_NAME_MISMATCH
   java.text.NumberFormat | java.awt.Stroke | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.text.NumberFormat of variable this.numberFormatOverride does not match with type java.awt.Stroke of variable this.advanceLineStroke
   - Make classes java.text.NumberFormat and java.awt.Stroke extend a common superclass

   14

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

   15

       return false;

   15 | return false;
   15 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   15

       return false;

   Precondition Violations (24)
   Row | Violation
   --- | ---
   1 | Unmatched return false;
   2 | Unmatched return false;
   3 | Expression that.autoRangeIncludesZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression that.advanceLineVisible cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Expression that.autoRangeStickyZero cannot be parameterized, because it has dependencies to/from statements that will be extracted
   6 | Expression that.boundMappedToLastCycle cannot be parameterized, because it has dependencies to/from statements that will be extracted
   7 | Type org.jfree.chart.axis.NumberTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.advanceLinePaint
   8 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   9 | Type java.text.NumberFormat of variable this.numberFormatOverride does not match with type java.awt.Stroke of variable this.advanceLineStroke
   10 | Clone fragment #1 returns variable that with type org.jfree.chart.axis.NumberAxis , while Clone fragment #2 returns variable that with type org.jfree.chart.axis.CyclicNumberAxis
   11 | Conditional return true;
   12 | Conditional return true;
   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;
   22 | Conditional return false;
   23 | Conditional return false;
   24 | Conditional return false;