43-117-139

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;
if (obj == this) { return true; } if (!(obj instanceof StandardXYZToolTipGenerator)) { return false; } if (!super.equals(obj)) { return false; } StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator) obj; if (!ObjectUtilities.equal(this.zFormat, that.zFormat)) { return false; } if (!ObjectUtilities.equal(this.zDateFormat, that.zDateFormat)) { return false; } return true;

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

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

                return true;↵

3

            }↵

3

            }↵

4

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

4

            if (!(obj instanceof StandardXYZToolTipGenerator)) {↵

5

                return false;↵

5

                return false;↵

6

            }↵

6

            }↵

7

            if (!(obj instanceof ValueMarker)) {↵

7

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

8

                return false;↵

8

                return false;↵

9

            }↵

9

            }↵

10

            ValueMarker that = (ValueMarker) obj;↵

10

            ↵

11

            if (this.value != that.value↵

11

    StandardXYZToolTipGenerator that = (StandardXYZToolTipGenerator) obj;↵

12

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

13

                return false;↵

14

            }↵

12

    ) {↵

15

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

13

                return false;↵

16

                return false;↵

14

            }↵

17

            }↵

15

            return true;

18

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

1. {Non-refactorable}

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

   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 (!super.equals(obj))

   5

       if (!super.equals(obj))

   4

       return false;

   4 | return false;
   6 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   6

       return false;

   5

       if (!(obj instanceof ValueMarker))

   5 | if (!(obj instanceof ValueMarker))
   3 | if (!(obj instanceof StandardXYZToolTipGenerator))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.ValueMarker | org.jfree.chart.labels.StandardXYZToolTipGenerator | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof ValueMarker does not match with type boolean of variable obj instanceof StandardXYZToolTipGenerator
   - Make classes org.jfree.chart.plot.ValueMarker and org.jfree.chart.labels.StandardXYZToolTipGenerator extend a common superclass

   3

       if (!(obj instanceof StandardXYZToolTipGenerator))

   6

       return false;

   6 | return false;
   4 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   4

       return false;

   Precondition Violations (7)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof ValueMarker does not match with type boolean of variable obj instanceof StandardXYZToolTipGenerator
   2 | Conditional return true;
   3 | Conditional return true;
   4 | Conditional return false;
   5 | Conditional return false;
   6 | Conditional return false;
   7 | Conditional return false;