1252-1-2

Object result = null; if (this.equals(TickType.MAJOR)) { result = TickType.MAJOR; } else if (this.equals(TickType.MINOR)) { result = TickType.MINOR; } return result;
Object result = null; if (this.equals(PlotOrientation.HORIZONTAL)) { result = PlotOrientation.HORIZONTAL; } else if (this.equals(PlotOrientation.VERTICAL)) { result = PlotOrientation.VERTICAL; } return result;

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

1

    Object result = null;↵

1

    Object result = null;↵

2

            if (this.equals(TickType.MAJOR)) {↵

2

            if (this.equals(PlotOrientation.HORIZONTAL)) {↵

3

                result = TickType.MAJOR;↵

3

                result = PlotOrientation.HORIZONTAL;↵

4

            }↵

4

            }↵

5

            else if (this.equals(TickType.MINOR)) {↵

5

            else if (this.equals(PlotOrientation.VERTICAL)) {↵

6

                result = TickType.MINOR;↵

6

                result = PlotOrientation.VERTICAL;↵

7

            }↵

7

            }↵

8

            return result;

8

            return result;

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

1. {Non-refactorable}

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

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

   1

       Object result = null;

   1

       Object result = null;

   2

       if (this.equals(TickType.MAJOR))

   2 | if (this.equals(TickType.MAJOR))
   2 | if (this.equals(PlotOrientation.HORIZONTAL))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.TickType | org.jfree.chart.plot.PlotOrientation | VARIABLE_TYPE_MISMATCH
   MAJOR | HORIZONTAL | VARIABLE_NAME_MISMATCH
   org.jfree.chart.axis.TickType | org.jfree.chart.plot.PlotOrientation | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.axis.TickType of variable TickType does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation
   - Make classes org.jfree.chart.axis.TickType and org.jfree.chart.plot.PlotOrientation extend a common superclass

   Type org.jfree.chart.axis.TickType of variable TickType.MAJOR does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL
   - Make classes org.jfree.chart.axis.TickType and org.jfree.chart.plot.PlotOrientation extend a common superclass

   2

       if (this.equals(PlotOrientation.HORIZONTAL))

   3 | result = PlotOrientation.HORIZONTAL;

   Preondition Violations
   Unmatched statement result=PlotOrientation.HORIZONTAL; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   3

       result = PlotOrientation.HORIZONTAL;

   3

       result = TickType.MAJOR;

   3 | result = TickType.MAJOR;

   Preondition Violations
   Unmatched statement result=TickType.MAJOR; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   4

       else if (this.equals(TickType.MINOR))

   4 | else if (this.equals(TickType.MINOR))
   4 | else if (this.equals(PlotOrientation.VERTICAL))

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.axis.TickType | org.jfree.chart.plot.PlotOrientation | VARIABLE_TYPE_MISMATCH
   MINOR | VERTICAL | VARIABLE_NAME_MISMATCH
   org.jfree.chart.axis.TickType | org.jfree.chart.plot.PlotOrientation | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.axis.TickType of variable TickType does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation
   - Make classes org.jfree.chart.axis.TickType and org.jfree.chart.plot.PlotOrientation extend a common superclass

   Type org.jfree.chart.axis.TickType of variable TickType.MINOR does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL
   - Make classes org.jfree.chart.axis.TickType and org.jfree.chart.plot.PlotOrientation extend a common superclass

   4

       else if (this.equals(PlotOrientation.VERTICAL))

   5 | result = PlotOrientation.VERTICAL;

   Preondition Violations
   Unmatched statement result=PlotOrientation.VERTICAL; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   5

       result = PlotOrientation.VERTICAL;

   5

       result = TickType.MINOR;

   5 | result = TickType.MINOR;

   Preondition Violations
   Unmatched statement result=TickType.MINOR; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   6

       return result;

   6

       return result;

   Precondition Violations (8)
   Row | Violation
   --- | ---
   1 | Type org.jfree.chart.axis.TickType of variable TickType does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation
   2 | Type org.jfree.chart.axis.TickType of variable TickType.MAJOR does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.HORIZONTAL
   3 | Unmatched statement result=PlotOrientation.HORIZONTAL; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   4 | Unmatched statement result=TickType.MAJOR; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   5 | Type org.jfree.chart.axis.TickType of variable TickType does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation
   6 | Type org.jfree.chart.axis.TickType of variable TickType.MINOR does not match with type org.jfree.chart.plot.PlotOrientation of variable PlotOrientation.VERTICAL
   7 | Unmatched statement result=PlotOrientation.VERTICAL; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   8 | Unmatched statement result=TickType.MINOR; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted