1071-7-8

if (this.equals(DomainOrder.ASCENDING)) { return DomainOrder.ASCENDING; } else if (this.equals(DomainOrder.DESCENDING)) { return DomainOrder.DESCENDING; } else if (this.equals(DomainOrder.NONE)) { return DomainOrder.NONE; } return null;
if (this.equals(RangeType.FULL)) { return RangeType.FULL; } else if (this.equals(RangeType.POSITIVE)) { return RangeType.POSITIVE; } else if (this.equals(RangeType.NEGATIVE)) { return RangeType.NEGATIVE; } return null;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/DomainOrder.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/RangeType.java
Method name: `Object readResolve()` |  | Method name: `Object readResolve()`
Number of AST nodes: 7 |  | Number of AST nodes: 7

1

    if (this.equals(DomainOrder.ASCENDING)) {↵

1

    if (this.equals(RangeType.FULL)) {↵

2

                return DomainOrder.ASCENDING;↵

2

                return RangeType.FULL;↵

3

            }↵

3

            }↵

4

            else if (this.equals(DomainOrder.DESCENDING)) {↵

4

            else if (this.equals(RangeType.POSITIVE)) {↵

5

                return DomainOrder.DESCENDING;↵

5

                return RangeType.POSITIVE;↵

6

            }↵

6

            }↵

7

            else if (this.equals(DomainOrder.NONE)) {↵

7

            else if (this.equals(RangeType.NEGATIVE)) {↵

8

                return DomainOrder.NONE;↵

8

                return RangeType.NEGATIVE;↵

9

            }↵

9

            }↵

10

            return null;

10

            return null;

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 | 28

1. {Non-refactorable}

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

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

   1

       if (this.equals(DomainOrder.ASCENDING))

   1 | if (this.equals(DomainOrder.ASCENDING))
   1 | if (this.equals(RangeType.FULL))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.DomainOrder | org.jfree.data.RangeType | VARIABLE_TYPE_MISMATCH
   ASCENDING | FULL | VARIABLE_NAME_MISMATCH
   org.jfree.data.DomainOrder | org.jfree.data.RangeType | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.DomainOrder of variable DomainOrder does not match with type org.jfree.data.RangeType of variable RangeType
   - Make classes org.jfree.data.DomainOrder and org.jfree.data.RangeType extend a common superclass

   Type org.jfree.data.DomainOrder of variable DomainOrder.ASCENDING does not match with type org.jfree.data.RangeType of variable RangeType.FULL
   - Make classes org.jfree.data.DomainOrder and org.jfree.data.RangeType extend a common superclass

   1

       if (this.equals(RangeType.FULL))

   2 | return RangeType.FULL;

   Preondition Violations
   Unmatched return RangeType.FULL;

   2

       return RangeType.FULL;

   2

       return DomainOrder.ASCENDING;

   2 | return DomainOrder.ASCENDING;

   Preondition Violations
   Unmatched return DomainOrder.ASCENDING;

   3

       else if (this.equals(DomainOrder.DESCENDING))

   3 | else if (this.equals(DomainOrder.DESCENDING))
   3 | else if (this.equals(RangeType.POSITIVE))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.DomainOrder | org.jfree.data.RangeType | VARIABLE_TYPE_MISMATCH
   DESCENDING | POSITIVE | VARIABLE_NAME_MISMATCH
   org.jfree.data.DomainOrder | org.jfree.data.RangeType | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.DomainOrder of variable DomainOrder does not match with type org.jfree.data.RangeType of variable RangeType
   - Make classes org.jfree.data.DomainOrder and org.jfree.data.RangeType extend a common superclass

   Type org.jfree.data.DomainOrder of variable DomainOrder.DESCENDING does not match with type org.jfree.data.RangeType of variable RangeType.POSITIVE
   - Make classes org.jfree.data.DomainOrder and org.jfree.data.RangeType extend a common superclass

   3

       else if (this.equals(RangeType.POSITIVE))

   4 | return RangeType.POSITIVE;

   Preondition Violations
   Unmatched return RangeType.POSITIVE;

   4

       return RangeType.POSITIVE;

   4

       return DomainOrder.DESCENDING;

   4 | return DomainOrder.DESCENDING;

   Preondition Violations
   Unmatched return DomainOrder.DESCENDING;

   5

       else if (this.equals(DomainOrder.NONE))

   5 | else if (this.equals(DomainOrder.NONE))
   5 | else if (this.equals(RangeType.NEGATIVE))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.DomainOrder | org.jfree.data.RangeType | VARIABLE_TYPE_MISMATCH
   NONE | NEGATIVE | VARIABLE_NAME_MISMATCH
   org.jfree.data.DomainOrder | org.jfree.data.RangeType | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.data.DomainOrder of variable DomainOrder does not match with type org.jfree.data.RangeType of variable RangeType
   - Make classes org.jfree.data.DomainOrder and org.jfree.data.RangeType extend a common superclass

   Type org.jfree.data.DomainOrder of variable DomainOrder.NONE does not match with type org.jfree.data.RangeType of variable RangeType.NEGATIVE
   - Make classes org.jfree.data.DomainOrder and org.jfree.data.RangeType extend a common superclass

   5

       else if (this.equals(RangeType.NEGATIVE))

   6 | return RangeType.NEGATIVE;

   Preondition Violations
   Unmatched return RangeType.NEGATIVE;

   6

       return RangeType.NEGATIVE;

   6

       return DomainOrder.NONE;

   6 | return DomainOrder.NONE;

   Preondition Violations
   Unmatched return DomainOrder.NONE;

   7

       return null;

   7

       return null;

   Precondition Violations (12)
   Row | Violation
   --- | ---
   1 | Type org.jfree.data.DomainOrder of variable DomainOrder does not match with type org.jfree.data.RangeType of variable RangeType
   2 | Type org.jfree.data.DomainOrder of variable DomainOrder.ASCENDING does not match with type org.jfree.data.RangeType of variable RangeType.FULL
   3 | Unmatched return RangeType.FULL;
   4 | Unmatched return DomainOrder.ASCENDING;
   5 | Type org.jfree.data.DomainOrder of variable DomainOrder does not match with type org.jfree.data.RangeType of variable RangeType
   6 | Type org.jfree.data.DomainOrder of variable DomainOrder.DESCENDING does not match with type org.jfree.data.RangeType of variable RangeType.POSITIVE
   7 | Unmatched return RangeType.POSITIVE;
   8 | Unmatched return DomainOrder.DESCENDING;
   9 | Type org.jfree.data.DomainOrder of variable DomainOrder does not match with type org.jfree.data.RangeType of variable RangeType
   10 | Type org.jfree.data.DomainOrder of variable DomainOrder.NONE does not match with type org.jfree.data.RangeType of variable RangeType.NEGATIVE
   11 | Unmatched return RangeType.NEGATIVE;
   12 | Unmatched return DomainOrder.NONE;