1714-3-4

for (int item = 0; item < itemCount; item++) { lvalue = intervalXYData.getStartXValue(series, item); uvalue = intervalXYData.getEndXValue(series, item); minimum = Math.min(minimum, lvalue); maximum = Math.max(maximum, uvalue); }
int itemCount = dataset.getItemCount(series); for (int item = 0; item < itemCount; item++) { lvalue = dataset.getXValue(series, item); uvalue = lvalue; minimum = Math.min(minimum, lvalue); maximum = Math.max(maximum, uvalue); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/general/DatasetUtilities.java
Method name: `Range iterateDomainBounds(XYDataset, boolean)` |  | Method name: `Range iterateDomainBounds(XYDataset, boolean)`
Number of AST nodes: 5 |  | Number of AST nodes: 6

1

    int itemCount = dataset.getItemCount(series);↵

1

    for (int item = 0; item < itemCount; item++) {↵

2

                    for (int item = 0; item < itemCount; item++) {↵

2

                        lvalue = intervalXYData.getStartXValue(series, item);↵

3

                        lvalue = dataset.getXValue(series, item);↵

3

                        uvalue = intervalXYData.getEndXValue(series, item);↵

4

                        uvalue = lvalue;↵

4

                        minimum = Math.min(minimum, lvalue);↵

5

                        minimum = Math.min(minimum, lvalue);↵

5

                        maximum = Math.max(maximum, uvalue);↵

6

                        maximum = Math.max(maximum, uvalue);↵

6

                    }

7

                    }

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.2
Clones location | Clones are in the same method
Number of node comparisons | 28

1. {Non-refactorable}

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

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

   18 | int itemCount = dataset.getItemCount(series);

   Preondition Violations
   Unmatched statement int itemCount=dataset.getItemCount(series); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   18

       int itemCount = dataset.getItemCount(series);

   12

       for (int item = 0; item < itemCount; item++)

   19

       for (int item = 0; item < itemCount; item++)

   13

       lvalue = intervalXYData.getStartXValue(series, item);

   13 | lvalue = intervalXYData.getStartXValue(series, item);

   Preondition Violations
   Unmatched statement lvalue=intervalXYData.getStartXValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   20 | lvalue = dataset.getXValue(series, item);

   Preondition Violations
   Unmatched statement lvalue=dataset.getXValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted

   20

       lvalue = dataset.getXValue(series, item);

   14

       uvalue = intervalXYData.getEndXValue(series, item);

   14 | uvalue = intervalXYData.getEndXValue(series, item);
   21 | uvalue = lvalue;

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   intervalXYData.getEndXValue(series,item) | lvalue | TYPE_COMPATIBLE_REPLACEMENT

   Preondition Violations
   Expression intervalXYData.getEndXValue(series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted

   21

       uvalue = lvalue;

   15

       minimum = Math.min(minimum, lvalue);

   22

       minimum = Math.min(minimum, lvalue);

   16

       maximum = Math.max(maximum, uvalue);

   23

       maximum = Math.max(maximum, uvalue);

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Unmatched statement int itemCount=dataset.getItemCount(series); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   2 | Unmatched statement lvalue=intervalXYData.getStartXValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   3 | Unmatched statement lvalue=dataset.getXValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   4 | Expression intervalXYData.getEndXValue(series,item) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   5 | Clone fragment #1 returns variables item, minimum, maximum , while Clone fragment #2 returns variables item, minimum, maximum