43-117-126

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 YIntervalRenderer)) { return false; } YIntervalRenderer that = (YIntervalRenderer) obj; if (!ObjectUtilities.equal(this.additionalItemLabelGenerator, that.additionalItemLabelGenerator)) { return false; } return super.equals(obj);

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/renderer/xy/YIntervalRenderer.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 10 |  | Number of AST nodes: 8

1

    if (obj == this) {↵

1

    if (obj == this) {↵

2

                return true;↵

2

        		return true;↵

3

            }↵

3

        ↵

4

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

5

                return false;↵

6

            }↵

4

    	}↵

7

            if (!(obj instanceof ValueMarker)) {↵

5

        	if (!(obj instanceof YIntervalRenderer)) {↵

8

                return false;↵

6

        		return false;↵

9

            }↵

7

        	}↵

10

            ValueMarker that = (ValueMarker) obj;↵

8

        ↵

11

            if (this.value != that.value↵

9

    	YIntervalRenderer that = (YIntervalRenderer) obj;↵

10

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

12

    ) {↵

11

        			that.additionalItemLabelGenerator)) {↵

13

                return false;↵

12

        		return false;↵

14

            }↵

13

        	}↵

15

            return true;

14

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

1. {Non-refactorable}

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

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

   1

       if (obj == this)

   1

       if (obj == this)

   2

       return true;

   2

       return true;

   3

       if (!super.equals(obj))

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

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

   3

       if (!(obj instanceof YIntervalRenderer))

   4

       return false;

   4

       return false;

   5

       YIntervalRenderer that = (YIntervalRenderer)obj;

   5

       if (!(obj instanceof ValueMarker))

   5 | if (!(obj instanceof ValueMarker))
   6 | if (! ObjectUtilities.equal(this.additionalItemLabelGenerator, that.additionalItemLabelGenerator))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   (obj instanceof ValueMarker) | ObjectUtilities.equal(this.additionalItemLabelGenerator,that.additionalItemLabelGenerator) | TYPE_COMPATIBLE_REPLACEMENT

   6

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

   6

       return false;

   7

       return false;

   7

       ValueMarker that = (ValueMarker)obj;

   8

       if (this.value != that.value)

   9

       return false;

   9 | return false;

   Preondition Violations
   Unmatched return false;

   10

       return true;

   10 | return true;
   8 | return super.equals(obj);

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

   8

       return super.equals(obj);

   Precondition Violations (1)
   Row | Violation
   --- | ---
   1 | Unmatched return false;