215-4-11

if (this.equals(DialShape.CIRCLE)) { return DialShape.CIRCLE; } else if (this.equals(DialShape.CHORD)) { return DialShape.CHORD; } else if (this.equals(DialShape.PIE)) { return DialShape.PIE; } return null;
if (this.equals(LengthConstraintType.NONE)) { return LengthConstraintType.NONE; } else if (this.equals(LengthConstraintType.RANGE)) { return LengthConstraintType.RANGE; } else if (this.equals(LengthConstraintType.FIXED)) { return LengthConstraintType.FIXED; } return null;

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

1

    if (this.equals(DialShape.CIRCLE)) {↵

1

    if (this.equals(LengthConstraintType.NONE)) {↵

2

                return DialShape.CIRCLE;↵

2

                return LengthConstraintType.NONE;↵

3

            }↵

3

            }↵

4

            else if (this.equals(DialShape.CHORD)) {↵

4

            else if (this.equals(↵

5

                return DialShape.CHORD↵

5

    LengthConstraintType.RANGE)) {↵

6

    ;↵

6

                return LengthConstraintType.RANGE;↵

7

            }      ↵

7

            }↵

8

            else if (this.equals(DialShape.PIE)) {↵

8

            else if (this.equals(LengthConstraintType.FIXED)) {↵

9

                return DialShape.PIE;↵

9

                return LengthConstraintType.FIXED;↵

10

            }      ↵

10

            }↵

11

            return null;

11

            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) | 1.3
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) | 1.4
   Clone type | Type 2

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

   1

       if (this.equals(DialShape.CIRCLE))

   1 | if (this.equals(DialShape.CIRCLE))
   1 | if (this.equals(LengthConstraintType.NONE))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.DialShape | org.jfree.chart.block.LengthConstraintType | VARIABLE_TYPE_MISMATCH
   CIRCLE | NONE | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.DialShape | org.jfree.chart.block.LengthConstraintType | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.DialShape of variable DialShape does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType
   - Make classes org.jfree.chart.plot.DialShape and org.jfree.chart.block.LengthConstraintType extend a common superclass

   Type org.jfree.chart.plot.DialShape of variable DialShape.CIRCLE does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.NONE
   - Make classes org.jfree.chart.plot.DialShape and org.jfree.chart.block.LengthConstraintType extend a common superclass

   1

       if (this.equals(LengthConstraintType.NONE))

   2 | return LengthConstraintType.NONE;

   Preondition Violations
   Unmatched return LengthConstraintType.NONE;

   2

       return LengthConstraintType.NONE;

   2

       return DialShape.CIRCLE;

   2 | return DialShape.CIRCLE;

   Preondition Violations
   Unmatched return DialShape.CIRCLE;

   3

       else if (this.equals(DialShape.CHORD))

   3 | else if (this.equals(DialShape.CHORD))
   3 | else if (this.equals(LengthConstraintType.RANGE))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.DialShape | org.jfree.chart.block.LengthConstraintType | VARIABLE_TYPE_MISMATCH
   CHORD | RANGE | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.DialShape | org.jfree.chart.block.LengthConstraintType | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.DialShape of variable DialShape does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType
   - Make classes org.jfree.chart.plot.DialShape and org.jfree.chart.block.LengthConstraintType extend a common superclass

   Type org.jfree.chart.plot.DialShape of variable DialShape.CHORD does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.RANGE
   - Make classes org.jfree.chart.plot.DialShape and org.jfree.chart.block.LengthConstraintType extend a common superclass

   3

       else if (this.equals(LengthConstraintType.RANGE))

   4 | return LengthConstraintType.RANGE;

   Preondition Violations
   Unmatched return LengthConstraintType.RANGE;

   4

       return LengthConstraintType.RANGE;

   4

       return DialShape.CHORD;

   4 | return DialShape.CHORD;

   Preondition Violations
   Unmatched return DialShape.CHORD;

   5

       else if (this.equals(DialShape.PIE))

   5 | else if (this.equals(DialShape.PIE))
   5 | else if (this.equals(LengthConstraintType.FIXED))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.DialShape | org.jfree.chart.block.LengthConstraintType | VARIABLE_TYPE_MISMATCH
   PIE | FIXED | VARIABLE_NAME_MISMATCH
   org.jfree.chart.plot.DialShape | org.jfree.chart.block.LengthConstraintType | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.plot.DialShape of variable DialShape does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType
   - Make classes org.jfree.chart.plot.DialShape and org.jfree.chart.block.LengthConstraintType extend a common superclass

   Type org.jfree.chart.plot.DialShape of variable DialShape.PIE does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.FIXED
   - Make classes org.jfree.chart.plot.DialShape and org.jfree.chart.block.LengthConstraintType extend a common superclass

   5

       else if (this.equals(LengthConstraintType.FIXED))

   6 | return LengthConstraintType.FIXED;

   Preondition Violations
   Unmatched return LengthConstraintType.FIXED;

   6

       return LengthConstraintType.FIXED;

   6

       return DialShape.PIE;

   6 | return DialShape.PIE;

   Preondition Violations
   Unmatched return DialShape.PIE;

   7

       return null;

   7

       return null;

   Precondition Violations (12)
   Row | Violation
   --- | ---
   1 | Type org.jfree.chart.plot.DialShape of variable DialShape does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType
   2 | Type org.jfree.chart.plot.DialShape of variable DialShape.CIRCLE does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.NONE
   3 | Unmatched return LengthConstraintType.NONE;
   4 | Unmatched return DialShape.CIRCLE;
   5 | Type org.jfree.chart.plot.DialShape of variable DialShape does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType
   6 | Type org.jfree.chart.plot.DialShape of variable DialShape.CHORD does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.RANGE
   7 | Unmatched return LengthConstraintType.RANGE;
   8 | Unmatched return DialShape.CHORD;
   9 | Type org.jfree.chart.plot.DialShape of variable DialShape does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType
   10 | Type org.jfree.chart.plot.DialShape of variable DialShape.PIE does not match with type org.jfree.chart.block.LengthConstraintType of variable LengthConstraintType.FIXED
   11 | Unmatched return LengthConstraintType.FIXED;
   12 | Unmatched return DialShape.PIE;