43-103-117

if (obj == this) { return true; } if (!(obj instanceof VectorRenderer)) { return false; } VectorRenderer that = (VectorRenderer) obj; if (this.baseLength != that.baseLength) { return false; } if (this.headLength != that.headLength) { return false; } return super.equals(obj);
if (obj == this) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof ValueMarker)) { return false; } ValueMarker that = (ValueMarker) obj; if (this.value != that.value) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/renderer/xy/VectorRenderer.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/plot/ValueMarker.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 10 |  | Number of AST nodes: 10

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

            if (!(obj instanceof VectorRenderer)) {↵

4

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

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            VectorRenderer that = (VectorRenderer) obj;↵

7

            ↵

8

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

8

    if (!(obj instanceof ValueMarker)) {↵

9

                return false;↵

9

                return false;↵

10

            }↵

10

            }↵

11

            if (this.headLength != that.headLength↵

11

            ValueMarker that = (ValueMarker) obj;↵

12

    ) {↵

12

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

13

                return false;↵

13

                return false;↵

14

            }↵

14

            }↵

15

            return super.equals(obj);

15

            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.5
Clones location | Clones are in different classes
Number of node comparisons | 35

1. {Non-refactorable}

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

   3 | if (!(obj instanceof VectorRenderer))
   3 | if (! super.equals(obj))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   (obj instanceof VectorRenderer) | super.equals(obj) | TYPE_COMPATIBLE_REPLACEMENT

   3

       if (!super.equals(obj))

   4

       return false;

   4 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   5

       if (!(obj instanceof ValueMarker))

   6 | return false;

   Preondition Violations
   Unmatched return false;

   6

       return false;

   5

       VectorRenderer that = (VectorRenderer)obj;

   7

       ValueMarker that = (ValueMarker)obj;

   6

       if (this.baseLength != that.baseLength)

   6 | if (this.baseLength != that.baseLength)
   8 | if (this.value != that.value)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   baseLength | value | VARIABLE_NAME_MISMATCH
   org.jfree.chart.renderer.xy.VectorRenderer | org.jfree.chart.plot.ValueMarker | VARIABLE_TYPE_MISMATCH
   baseLength | value | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.chart.renderer.xy.VectorRenderer of variable that does not match with type org.jfree.chart.plot.ValueMarker of variable that
   - Make classes org.jfree.chart.renderer.xy.VectorRenderer and org.jfree.chart.plot.ValueMarker extend a common superclass

   8

       if (this.value != that.value)

   7

       return false;

   7 | return false;
   9 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   9

       return false;

   Precondition Violations (8)
   Row | Violation
   --- | ---
   1 | Unmatched return false;
   2 | Type org.jfree.chart.renderer.xy.VectorRenderer of variable that does not match with type org.jfree.chart.plot.ValueMarker of variable that
   3 | Conditional return true;
   4 | Conditional return true;
   5 | Conditional return false;
   6 | Conditional return false;
   7 | Conditional return false;
   8 | Conditional return false;