453-2-3

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);
if (this == obj) { return true; } if (obj instanceof Tick) { Tick t = (Tick) obj; if (!ObjectUtilities.equal(this.text, t.text)) { return false; } if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) { return false; } if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) { return false; } if (!(this.angle == t.angle)) { return false; } return true; } return false;

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

1

    if (obj == this) {↵

1

    if (this == obj) {↵

2

                return true;↵

2

                return true;   ↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof SymbolAxis)) {↵

4

            if (obj instanceof Tick) {↵

5

                return false;↵

5

                ↵

6

            }↵

7

            SymbolAxis that = (SymbolAxis) obj;↵

8

            if (!this.symbol↵

6

    Tick t = (Tick) obj;   ↵

9

    s.equals(that.symbols)) {↵

7

                if (!ObjectUtilities.equal(this.text, t.text)) {↵

10

                return false;↵

8

                    return false;   ↵

11

            }↵

9

            ↵

10

        }↵

12

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

11

                if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor)) {↵

13

                return false;↵

12

                    return false;↵

13

       ↵

14

            }↵

14

                }↵

15

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

15

                if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor)) {↵

16

                return false;↵

16

                    return false;   ↵

17

            }↵

17

             ↵

18

       }↵

18

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

19

                if (!↵

19

                    that.gridBandAlternatePaint)) {↵

20

    (this.angle == t.angle)) {↵

21

                    return false;   ↵

22

                }↵

20

                return false;↵

23

                return true;↵

21

            }↵

24

            }↵

22

            return super.equals(obj);

25

            return false;

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 6
   Number of unmapped statements in the first code fragment | 5
   Number of unmapped statements in the second code fragment | 3
   Time elapsed for statement mapping (ms) | 1.5
   Clone type | Type 3

   Mapped Statements
   ID | Statement |  | ID | Statement
   --- | --- | --- | --- | ---

   4

       Tick t = (Tick)obj;

   3

       if (!(obj instanceof SymbolAxis))

   11

       if (!(this.angle == t.angle))

   4

       return false;

   4 | return false;
   12 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   12

       return false;

   5

       SymbolAxis that = (SymbolAxis)obj;

   6

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

   7

       return false;

   7 | return false;

   Preondition Violations
   Unmatched return false;

   8

       if (this.gridBandsVisible != that.gridBandsVisible)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

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

   10 | if (! PaintUtilities.equal(this.gridBandPaint, that.gridBandPaint))
   7 | if (! ObjectUtilities.equal(this.textAnchor, t.textAnchor))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   gridBandPaint | textAnchor | VARIABLE_NAME_MISMATCH
   java.awt.Paint | org.jfree.ui.TextAnchor | VARIABLE_TYPE_MISMATCH
   org.jfree.util.PaintUtilities | org.jfree.util.ObjectUtilities | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type java.awt.Paint of variable this.gridBandPaint does not match with type org.jfree.ui.TextAnchor of variable this.textAnchor
   - Make classes java.awt.Paint and org.jfree.ui.TextAnchor extend a common superclass

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

   7

       if (!ObjectUtilities.equal(this.textAnchor, t.textAnchor))

   11

       return false;

   11 | return false;
   8 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   8

       return false;

   12

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

   12 | if (! PaintUtilities.equal(this.gridBandAlternatePaint, that.gridBandAlternatePaint))
   5 | if (! ObjectUtilities.equal(this.text, t.text))

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

   Preondition Violations

   Type java.awt.Paint of variable this.gridBandAlternatePaint does not match with type java.lang.String of variable this.text
   - Make classes java.awt.Paint and java.lang.String extend a common superclass

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

   5

       if (!ObjectUtilities.equal(this.text, t.text))

   13

       return false;

   13 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   9

       if (!ObjectUtilities.equal(this.rotationAnchor, t.rotationAnchor))

   10 | return false;

   Preondition Violations
   Unmatched return false;

   10

       return false;

   Precondition Violations (13)
   Row | Violation
   --- | ---
   1 | Unmatched return false;
   2 | Unmatched return false;
   3 | Type java.awt.Paint of variable this.gridBandPaint does not match with type org.jfree.ui.TextAnchor of variable this.textAnchor
   4 | Type org.jfree.util.PaintUtilities of variable PaintUtilities does not match with type org.jfree.util.ObjectUtilities of variable ObjectUtilities
   5 | Type java.awt.Paint of variable this.gridBandAlternatePaint does not match with type java.lang.String of variable this.text
   6 | Type org.jfree.util.PaintUtilities of variable PaintUtilities does not match with type org.jfree.util.ObjectUtilities of variable ObjectUtilities
   7 | Unmatched return false;
   8 | Conditional return false;
   9 | Conditional return false;
   10 | Conditional return false;
   11 | Conditional return false;
   12 | Conditional return false;
   13 | Conditional return false;