295-2-4

if (object == null) { return false; } if (object == this) { return true; } if (object instanceof DefaultTimeline) { return true; } return false;
if (object == null) { return false; } if (object == this) { return true; } if (super.equals(object) && object instanceof MiddlePinNeedle) { return true; } return false;

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

1

    if (object == null) {↵

1

    if (object == null) {↵

2

                    return false;↵

2

                return false;↵

3

                }↵

3

            }↵

4

                if (object == this) {↵

4

            if (object == this) {↵

5

                    return true;↵

5

                return true;↵

6

                }↵

6

            }↵

7

                if (object instanceof DefaultTimeline) {↵

7

            if (super.equals(object) && object instanceof MiddlePinNeedle) {↵

8

                    return true;↵

8

                return true;↵

9

                }↵

9

            ↵

10

        ↵

10

    }↵

11

            return false;

11

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 4
   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.3
   Clone type | Type 1

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

   1

       if (object == null)

   1

       if (object == null)

   2

       return false;

   2 | return false;
   2 | return false;

   Preondition Violations
   Conditional return false;
   Conditional return false;

   2

       return false;

   3

       if (object == this)

   3

       if (object == this)

   4

       return true;

   4 | return true;
   4 | return true;

   Preondition Violations
   Conditional return true;
   Conditional return true;

   4

       return true;

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Conditional return false;
   2 | Conditional return false;
   3 | Conditional return true;
   4 | Conditional return true;