43-25-72

if (obj == this) { return true; } if (!(obj instanceof OHLC)) { return false; } OHLC that = (OHLC) obj; if (this.open != that.open) { return false; } if (this.close != that.close) { return false; } if (this.high != that.high) { return false; } if (this.low != that.low) { return false; } return true;
if (obj == this) { return true; } if (!(obj instanceof Vector)) { return false; } Vector that = (Vector) obj; if (this.x != that.x) { return false; } if (this.y != that.y) { return false; } return true;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/ohlc/OHLC.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/xy/Vector.java
Method name: `boolean equals(Object)` |  | Method name: `boolean equals(Object)`
Number of AST nodes: 14 |  | 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 OHLC)) {↵

4

            if (!(obj instanceof ↵

5

                return false;↵

6

            }↵

7

            OHLC that = (OHLC) obj;↵

8

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

9

                return false;↵

10

            }↵

11

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

12

                return false;↵

13

            }↵

5

    Vector)) {↵

6

                return false;↵

7

            }↵

8

            Vector that = (Vector) obj;↵

14

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

9

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

15

                return false;↵

10

                return false;↵

16

            }↵

11

            }↵

17

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

12

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

18

                return false;↵

13

                return false;↵

19

            }↵

14

            }↵

20

            return true;

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 9
   Number of unmapped statements in the first code fragment | 5
   Number of unmapped statements in the second code fragment | 1
   Time elapsed for statement mapping (ms) | 0.8
   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 (!(obj instanceof OHLC))

   3 | if (!(obj instanceof OHLC))
   3 | if (!(obj instanceof Vector))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.time.ohlc.OHLC | org.jfree.data.xy.Vector | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type boolean of variable obj instanceof OHLC does not match with type boolean of variable obj instanceof Vector
   - Make classes org.jfree.data.time.ohlc.OHLC and org.jfree.data.xy.Vector extend a common superclass

   3

       if (!(obj instanceof Vector))

   4

       return false;

   4

       return false;

   5

       Vector that = (Vector)obj;

   5

       OHLC that = (OHLC)obj;

   6

       if (this.open != that.open)

   6 | if (this.open != that.open)
   6 | if (this.x != that.x)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   open | x | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.ohlc.OHLC | org.jfree.data.xy.Vector | VARIABLE_TYPE_MISMATCH
   open | x | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.data.time.ohlc.OHLC of variable that does not match with type org.jfree.data.xy.Vector of variable that
   - Make classes org.jfree.data.time.ohlc.OHLC and org.jfree.data.xy.Vector extend a common superclass

   6

       if (this.x != that.x)

   7

       return false;

   7

       return false;

   8

       if (this.close != that.close)

   8 | if (this.close != that.close)
   8 | if (this.y != that.y)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   close | y | VARIABLE_NAME_MISMATCH
   org.jfree.data.time.ohlc.OHLC | org.jfree.data.xy.Vector | VARIABLE_TYPE_MISMATCH
   close | y | VARIABLE_NAME_MISMATCH

   Preondition Violations

   Type org.jfree.data.time.ohlc.OHLC of variable that does not match with type org.jfree.data.xy.Vector of variable that
   - Make classes org.jfree.data.time.ohlc.OHLC and org.jfree.data.xy.Vector extend a common superclass

   8

       if (this.y != that.y)

   9

       return false;

   9

       return false;

   10

       if (this.high != that.high)

   11

       return false;

   11 | return false;

   Preondition Violations
   Unmatched return false;

   12

       if (this.low != that.low)

   13

       return false;

   13 | return false;

   Preondition Violations
   Unmatched return false;

   14

       return true;

   10

       return true;

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Type boolean of variable obj instanceof OHLC does not match with type boolean of variable obj instanceof Vector
   2 | Type org.jfree.data.time.ohlc.OHLC of variable that does not match with type org.jfree.data.xy.Vector of variable that
   3 | Type org.jfree.data.time.ohlc.OHLC of variable that does not match with type org.jfree.data.xy.Vector of variable that
   4 | Unmatched return false;
   5 | Unmatched return false;