43-15-54

if (obj == this) { return true; } if (!(obj instanceof DateAxis)) { return false; } DateAxis that = (DateAxis) obj; if (!ObjectUtilities.equal(this.tickUnit, that.tickUnit)) { return false; } if (!ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride)) { return false; } if (!ObjectUtilities.equal(this.tickMarkPosition, that.tickMarkPosition)) { return false; } if (!ObjectUtilities.equal(this.timeline, that.timeline)) { return false; } if (!super.equals(obj)) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof SymbolAxis)) { return false; } SymbolAxis that = (SymbolAxis) obj; if (!this.symbols.equals(that.symbols)) { return false; } if (this.gridBandsVisible != that.gridBandsVisible) { return false; } if (!PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint)) { return false; } if (!PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint)) { return false; } return super.equals(obj);

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

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof DateAxis)) {↵

4

            if (!(obj instanceof SymbolAxis)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            DateAxis that = (DateAxis) obj;↵

7

            SymbolAxis that = (SymbolAxis) obj;↵

8

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

8

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

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

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

11

            if (↵

12

                    that.dateFormatOverride)) {↵

12

    this.gridBandsVisible != that.gridBandsVisible) {↵

13

                return false;↵

13

                return false;↵

14

            }↵

14

            }↵

15

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

15

            if (!PaintUtilities.equal(this.↵

16

                    that.tickMarkPosition)) {↵

16

    gridBandPaint, that.gridBandPaint)) {↵

17

                return false;↵

17

                return false;↵

18

            }↵

18

            }↵

19

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

19

            if (!PaintUtilities.equal(this.↵

20

                return false;↵

20

    gridBandAlternatePaint, ↵

21

            }↵

21

            ↵

22

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

22

            that.gridBandAlternatePaint)) {↵

23

                return false;↵

23

                return false;↵

24

            }↵

24

            }↵

25

            return true;

25

            return super.equals(obj);

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

1. {Non-refactorable}

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

   3 | if (!(obj instanceof DateAxis))
   3 | if (!(obj instanceof SymbolAxis))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.DateAxis | org.jfree.chart.axis.SymbolAxis | SUBCLASS_TYPE_MISMATCH

   3

       if (!(obj instanceof SymbolAxis))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       DateAxis that = (DateAxis)obj;

   5 | DateAxis that = (DateAxis)obj;
   5 | SymbolAxis that = (SymbolAxis)obj;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.DateAxis | org.jfree.chart.axis.SymbolAxis | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.axis.DateAxis | org.jfree.chart.axis.SymbolAxis | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.axis.DateAxis | org.jfree.chart.axis.SymbolAxis | SUBCLASS_TYPE_MISMATCH

   5

       SymbolAxis that = (SymbolAxis)obj;

   8

       if (this.gridBandsVisible != that.gridBandsVisible)

   9 | return false;

   Preondition Violations
   Unmatched return false;

   9

       return false;

   6

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

   6 | if (! ObjectUtilities.equal(this.tickUnit, that.tickUnit))
   10 | if (! PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint))

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

   Preondition Violations

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

   10

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

   7

       return false;

   7 | return false;
   11 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   11

       return false;

   8

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

   8 | if (! ObjectUtilities.equal(this.dateFormatOverride, that.dateFormatOverride))
   12 | if (! PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   dateFormatOverride | gridBandAlternatePaint | VARIABLE_NAME_MISMATCH
   java.text.DateFormat | java.awt.Paint | VARIABLE_TYPE_MISMATCH
   org.jfree.util.ObjectUtilities | org.jfree.util.PaintUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.text.DateFormat of variable this.dateFormatOverride does not match with type java.awt.Paint of variable this.gridBandAlternatePaint
   - Make classes java.text.DateFormat 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.gridBandAlternatePaint, that.gridBandAlternatePaint))

   9

       return false;

   9 | return false;
   13 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   13

       return false;

   10

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

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

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

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       if (!super.equals(obj))

   14 | if (! super.equals(obj))
   6 | if (! this.symbols.equals(that.symbols))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   super.equals(obj) | this.symbols.equals(that.symbols) | TYPE_COMPATIBLE_REPLACEMENT

   Preondition Violations
   Expression this.symbols.equals(that.symbols) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   6

       if (!this.symbols.equals(that.symbols))

   15

       return false;

   15 | return false;
   7 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   7

       return false;

   Precondition Violations (19)
   Row | Violation
   --- | ---
   1 | Unmatched return false;
   2 | Type org.jfree.chart.axis.DateTickUnit of variable this.tickUnit does not match with type java.awt.Paint of variable this.gridBandPaint
   3 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   4 | Type java.text.DateFormat of variable this.dateFormatOverride does not match with type java.awt.Paint of variable this.gridBandAlternatePaint
   5 | Type org.jfree.util.ObjectUtilities of variable ObjectUtilities does not match with type org.jfree.util.PaintUtilities of variable PaintUtilities
   6 | Unmatched return false;
   7 | Unmatched return false;
   8 | Expression this.symbols.equals(that.symbols) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   9 | Clone fragment #1 returns variable that with type org.jfree.chart.axis.DateAxis , while Clone fragment #2 returns variable that with type org.jfree.chart.axis.SymbolAxis
   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;