1015-1-4

Axis domainAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; domainAxis = p.getDomainAxis(); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; domainAxis = p.getDomainAxis(); } if (domainAxis != null) { this.domainAxisPropertyPanel.setAxisProperties(domainAxis); }
Axis rangeAxis = null; if (plot instanceof CategoryPlot) { CategoryPlot p = (CategoryPlot) plot; rangeAxis = p.getRangeAxis(); } else if (plot instanceof XYPlot) { XYPlot p = (XYPlot) plot; rangeAxis = p.getRangeAxis(); } if (rangeAxis != null) this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/editor/DefaultPlotEditor.java |  | File path: /jfreechart-1.0.10/swt/org/jfree/experimental/chart/swt/editor/SWTPlotEditor.java
Method name: `void updatePlotProperties(Plot)` |  | Method name: `void updatePlotProperties(Plot)`
Number of AST nodes: 9 |  | Number of AST nodes: 9

1

    Axis domainAxis = null;
    ↵

1

    Axis rangeAxis = null;↵

2

                if (plot instanceof CategoryPlot) {
    ↵

2

                if (plot instanceof CategoryPlot) {↵

3

                    CategoryPlot p = (CategoryPlot) plot;
    ↵

3

                    CategoryPlot p = (CategoryPlot) plot;↵

4

                    domainAxis = p.getDomainAxis();
    ↵

4

                    rangeAxis = p.getRangeAxis();↵

5

                }
    ↵

5

                }↵

6

                else if (plot instanceof XYPlot) {
    ↵

6

                else if (plot instanceof XYPlot) {↵

7

                    XYPlot p = (XYPlot) plot;
    ↵

7

                    XYPlot p = (XYPlot) plot;↵

8

                    domainAxis = p.getDomainAxis();
    ↵

8

                    rangeAxis = p.getRangeAxis();↵

9

                }
    ↵

9

                }↵

10

                if (domainAxis != null) {
    ↵

10

                if (rangeAxis != null)↵

11

                    this.domainAxisPropertyPanel.setAxisProperties(domainAxis);↵

11

                    this.rangeAxisPropertyPanel.setAxisProperties(↵

12

                }

12

    rangeAxis);

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 9
   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) | 1.6
   Clone type | Type 2

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

   6

       Axis domainAxis = null;

   6 | Axis domainAxis = null;
   15 | Axis rangeAxis = null;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   15

       Axis rangeAxis = null;

   7

       if (plot instanceof CategoryPlot)

   16

       if (plot instanceof CategoryPlot)

   8

       CategoryPlot p = (CategoryPlot)plot;

   17

       CategoryPlot p = (CategoryPlot)plot;

   9

       domainAxis = p.getDomainAxis();

   9 | domainAxis = p.getDomainAxis();
   18 | rangeAxis = p.getRangeAxis();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH
   getDomainAxis | getRangeAxis | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression p.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression p.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted

   18

       rangeAxis = p.getRangeAxis();

   10

       else if (plot instanceof XYPlot)

   19

       else if (plot instanceof XYPlot)

   11

       XYPlot p = (XYPlot)plot;

   20

       XYPlot p = (XYPlot)plot;

   12

       domainAxis = p.getDomainAxis();

   12 | domainAxis = p.getDomainAxis();
   21 | rangeAxis = p.getRangeAxis();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH
   getDomainAxis | getRangeAxis | METHOD_INVOCATION_NAME_MISMATCH

   Preondition Violations
   Expression p.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression p.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted

   21

       rangeAxis = p.getRangeAxis();

   13

       if (domainAxis != null)

   13 | if (domainAxis != null)
   22 | if (rangeAxis != null)

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH

   22

       if (rangeAxis != null)

   14

       this.domainAxisPropertyPanel.setAxisProperties(domainAxis);

   14 | this.domainAxisPropertyPanel.setAxisProperties(domainAxis);
   23 | this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   domainAxis | rangeAxis | VARIABLE_NAME_MISMATCH
   domainAxisPropertyPanel | rangeAxisPropertyPanel | VARIABLE_NAME_MISMATCH
   org.jfree.chart.editor.DefaultAxisEditor | org.jfree.experimental.chart.swt.editor.SWTAxisEditor | VARIABLE_TYPE_MISMATCH

   Preondition Violations

   Type org.jfree.chart.editor.DefaultAxisEditor of variable this.domainAxisPropertyPanel does not match with type org.jfree.experimental.chart.swt.editor.SWTAxisEditor of variable this.rangeAxisPropertyPanel
   - Make classes org.jfree.chart.editor.DefaultAxisEditor and org.jfree.experimental.chart.swt.editor.SWTAxisEditor extend a common superclass

   23

       this.rangeAxisPropertyPanel.setAxisProperties(rangeAxis);

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Expression p.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression p.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression p.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   4 | Expression p.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Type org.jfree.chart.editor.DefaultAxisEditor of variable this.domainAxisPropertyPanel does not match with type org.jfree.experimental.chart.swt.editor.SWTAxisEditor of variable this.rangeAxisPropertyPanel