327-1-2

Iterator l_itr = getSubplots().iterator(); while (l_itr.hasNext()) { XYPlot l_subplot = (XYPlot) l_itr.next(); l_subplot.setRangeAxis(0, axis, false); } super.setRangeAxis(axis); if (null == axis) { return; } axis.configure();
Iterator l_itr = getSubplots().iterator(); while (l_itr.hasNext()) { CategoryPlot l_subplot = (CategoryPlot) l_itr.next(); l_subplot.setRangeAxis(0, axis, false); } super.setRangeAxis(axis); if (null == axis) { return; } axis.configure();

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/experimental/org/jfree/experimental/chart/plot/CombinedXYPlot.java |  | File path: /jfreechart-1.0.10/experimental/org/jfree/experimental/chart/plot/CombinedCategoryPlot.java
Method name: `void setRangeAxis(ValueAxis)` |  | Method name: `void setRangeAxis(ValueAxis)`
Number of AST nodes: 8 |  | Number of AST nodes: 8

1

    Iterator l_itr = getSubplots().iterator();↵

1

    Iterator l_itr = getSubplots().iterator();↵

2

            while (l_itr.hasNext()) {↵

2

            while (l_itr.hasNext()) {↵

3

                XYPlot l_subplot = (XYPlot) l_itr.next();↵

3

                CategoryPlot l_subplot = (CategoryPlot) l_itr.next();↵

4

                l_subplot.setRangeAxis(0, axis, false);↵

4

                l_subplot.setRangeAxis(0, axis, false);↵

5

            }↵

5

            }↵

6

            super.setRangeAxis(axis);↵

6

            super.setRangeAxis(axis);↵

7

            if (null == axis) {↵

7

            if (null == axis) {↵

8

                return;↵

8

                return;↵

9

            }↵

9

            }↵

10

            axis.configure();

10

            axis.configure();

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

1. {Non-refactorable}

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

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

   1

       Iterator l_itr = getSubplots().iterator();

   1

       Iterator l_itr = getSubplots().iterator();

   2

       while (l_itr.hasNext())

   2

       while (l_itr.hasNext())

   3

       XYPlot l_subplot = (XYPlot)l_itr.next();

   3 | XYPlot l_subplot = (XYPlot)l_itr.next();
   3 | CategoryPlot l_subplot = (CategoryPlot)l_itr.next();

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.XYPlot | org.jfree.chart.plot.CategoryPlot | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.plot.XYPlot | org.jfree.chart.plot.CategoryPlot | SUBCLASS_TYPE_MISMATCH
   org.jfree.chart.plot.XYPlot | org.jfree.chart.plot.CategoryPlot | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression (XYPlot)l_itr.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression (CategoryPlot)l_itr.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted

   3

       CategoryPlot l_subplot = (CategoryPlot)l_itr.next();

   4

       l_subplot.setRangeAxis(0, axis, false);

   4 | l_subplot.setRangeAxis(0, axis, false);
   4 | l_subplot.setRangeAxis(0, axis, false);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.XYPlot | org.jfree.chart.plot.CategoryPlot | SUBCLASS_TYPE_MISMATCH

   Preondition Violations
   Expression l_subplot cannot be unified with expression l_subplot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public void setRangeAxis(int, org.jfree.chart.axis.ValueAxis, boolean)

   4

       l_subplot.setRangeAxis(0, axis, false);

   5

       super.setRangeAxis(axis);

   5

       super.setRangeAxis(axis);

   6

       if (null == axis)

   6

       if (null == axis)

   7

       return;

   7

       return;

   8

       axis.configure();

   8

       axis.configure();

   Precondition Violations (3)
   Row | Violation
   --- | ---
   1 | Expression (XYPlot)l_itr.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression (CategoryPlot)l_itr.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression l_subplot cannot be unified with expression l_subplot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public void setRangeAxis(int, org.jfree.chart.axis.ValueAxis, boolean)