1266-1-2

Range l_result = null; Iterator l_itr = getSubplots().iterator(); while (l_itr.hasNext()) { CategoryPlot l_subplot = (CategoryPlot) l_itr.next(); l_result = Range.combine(l_result, l_subplot.getDataRange(axis)); } return l_result;
Range l_result = null; Iterator l_itr = getSubplots().iterator(); while (l_itr.hasNext()) { XYPlot l_subplot = (XYPlot) l_itr.next(); l_result = Range.combine(l_result, l_subplot.getDataRange(axis)); } return l_result;

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

1

    Range l_result = null;↵

1

    Range l_result = null;↵

2

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

2

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

3

            while (l_itr.hasNext()) {↵

3

            while (l_itr.hasNext()) {↵

4

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

4

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

5

                l_result = Range.combine(l_result, l_subplot.getDataRange(axis));↵

5

                l_result = Range.combine(l_result, l_subplot.getDataRange(axis));↵

6

            }↵

6

            }↵

7

            return l_result;

7

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

1. {Non-refactorable}

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

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

   1

       Range l_result = null;

   1

       Range l_result = null;

   2

       Iterator l_itr = getSubplots().iterator();

   2

       Iterator l_itr = getSubplots().iterator();

   3

       while (l_itr.hasNext())

   3

       while (l_itr.hasNext())

   4

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

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

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

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

   4

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

   5

       l_result = Range.combine(l_result, l_subplot.getDataRange(axis));

   5 | l_result = Range.combine(l_result, l_subplot.getDataRange(axis));
   5 | l_result = Range.combine(l_result, l_subplot.getDataRange(axis));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.chart.plot.CategoryPlot | org.jfree.chart.plot.XYPlot | 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 org.jfree.data.Range getDataRange(org.jfree.chart.axis.ValueAxis)

   5

       l_result = Range.combine(l_result, l_subplot.getDataRange(axis));

   6

       return l_result;

   6

       return l_result;

   Precondition Violations (3)
   Row | Violation
   --- | ---
   1 | Expression (CategoryPlot)l_itr.next() cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression (XYPlot)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 org.jfree.data.Range getDataRange(org.jfree.chart.axis.ValueAxis)