245-1-2

CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot) super.clone(); result.subplots = (List) ObjectUtilities.deepClone(this.subplots); for (Iterator it = result.subplots.iterator(); it.hasNext();) { Plot child = (Plot) it.next(); child.setParent(result); } // after setting up all the subplots, the shared range axis may need // reconfiguring ValueAxis rangeAxis = result.getRangeAxis(); if (rangeAxis != null) { rangeAxis.configure(); } return result;
CombinedDomainXYPlot result = (CombinedDomainXYPlot) super.clone(); result.subplots = (List) ObjectUtilities.deepClone(this.subplots); for (Iterator it = result.subplots.iterator(); it.hasNext();) { Plot child = (Plot) it.next(); child.setParent(result); } // after setting up all the subplots, the shared domain axis may need // reconfiguring ValueAxis domainAxis = result.getDomainAxis(); if (domainAxis != null) { domainAxis.configure(); } return result;

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

1

    CombinedRangeCategoryPlot result ↵

1

    Combined↵

2

                = (CombinedRangeCategoryPlot) super.clone(); ↵

2

    DomainXYPlot result = (CombinedDomainXYPlot) super.clone();↵

3

            result.subplots = (List) ObjectUtilities.deepClone(this.subplots);↵

3

            result.subplots = (List) ObjectUtilities.deepClone(this.subplots);↵

4

            for (Iterator it = result.subplots.iterator(); it.hasNext();) {↵

4

            for (Iterator it = result.subplots.iterator(); it.hasNext();) {↵

5

                Plot child = (Plot) it.next();↵

5

                Plot child = (Plot) it.next();↵

6

                child.setParent(result);↵

6

                child.setParent(result);↵

7

            }↵

7

            }↵

8

            ↵

9

            // after setting up all the subplots, the shared range axis may need ↵

8

            // after setting up all the subplots, the shared domain axis may need↵

10

            // reconfiguring↵

9

            // reconfiguring↵

11

            ValueAxis rangeAxis = result.getRangeAxis();↵

10

            ValueAxis domainAxis = result.getDomainAxis();↵

12

            if (rangeAxis != null) {↵

11

            if (domainAxis != null) {↵

13

                rangeAxis.configure();↵

12

                domainAxis.configure();↵

14

            }↵

13

            }↵

15

            ↵

16

            return result;

14

            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.3
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 28

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

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

   1

       CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot)super.clone();

   1 | CombinedRangeCategoryPlot result = (CombinedRangeCategoryPlot)super.clone();
   1 | CombinedDomainXYPlot result = (CombinedDomainXYPlot)super.clone();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedRangeCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.plot.CombinedRangeCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.plot.CombinedRangeCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   1

       CombinedDomainXYPlot result = (CombinedDomainXYPlot)super.clone();

   2

       result.subplots = (List)ObjectUtilities.deepClone(this.subplots);

   2 | result.subplots = (List)ObjectUtilities.deepClone(this.subplots);
   2 | result.subplots = (List)ObjectUtilities.deepClone(this.subplots);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedRangeCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   2

       result.subplots = (List)ObjectUtilities.deepClone(this.subplots);

   3

       for (Iterator it = result.subplots.iterator(); it.hasNext(); )

   3 | for (Iterator it = result.subplots.iterator(); it.hasNext(); )
   3 | for (Iterator it = result.subplots.iterator(); it.hasNext(); )

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedRangeCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   3

       for (Iterator it = result.subplots.iterator(); it.hasNext(); )

   4

       Plot child = (Plot)it.next();

   4

       Plot child = (Plot)it.next();

   5

       child.setParent(result);

   5 | child.setParent(result);
   5 | child.setParent(result);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedRangeCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   5

       child.setParent(result);

   6

       ValueAxis rangeAxis = result.getRangeAxis();

   6 | ValueAxis rangeAxis = result.getRangeAxis();
   6 | ValueAxis domainAxis = result.getDomainAxis();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   rangeAxis | domainAxis | VARIABLE_NAME_MISMATCH
   getRangeAxis | getDomainAxis | METHOD_INVOCATION_NAME_MISMATCH
   org.jfree.chart.plot.CombinedRangeCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

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

   6

       ValueAxis domainAxis = result.getDomainAxis();

   7

       if (rangeAxis != null)

   7 | if (rangeAxis != null)
   7 | if (domainAxis != null)

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

   7

       if (domainAxis != null)

   8

       rangeAxis.configure();

   8 | rangeAxis.configure();
   8 | domainAxis.configure();

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

   8

       domainAxis.configure();

   9

       return result;

   9 | return result;
   9 | return result;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CombinedRangeCategoryPlot | org.jfree.chart.plot.CombinedDomainXYPlot | SUBCLASS_TYPE_MISMATCH

   9

       return result;

   Precondition Violations (2)
   Row | Violation
   --- | ---
   1 | Expression result.getRangeAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression result.getDomainAxis() cannot be parameterized, because it has dependencies to/from statements that will be extracted