1197-1-2

for (int series = 0; series < seriesCount; series++) { int itemCount = dataset.getItemCount(series); for (int item = 0; item < itemCount; item++) { double lvalue = ixyd.getStartYValue(series, item); double uvalue = ixyd.getEndYValue(series, item); if (!Double.isNaN(lvalue)) { minimum = Math.min(minimum, lvalue); } if (!Double.isNaN(uvalue)) { maximum = Math.max(maximum, uvalue); } } }
for (int series = 0; series < seriesCount; series++) { int itemCount = dataset.getItemCount(series); for (int item = 0; item < itemCount; item++) { double lvalue = ohlc.getLowValue(series, item); double uvalue = ohlc.getHighValue(series, item); if (!Double.isNaN(lvalue)) { minimum = Math.min(minimum, lvalue); } if (!Double.isNaN(uvalue)) { 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 iterateRangeBounds(XYDataset, boolean)` |  | Method name: `Range iterateRangeBounds(XYDataset, boolean)`
Number of AST nodes: 9 |  | Number of AST nodes: 9

1

    for (int series = 0; series < seriesCount; series++) {↵

1

    for (int series = 0; series < seriesCount; series++) {↵

2

                    int itemCount = dataset.getItemCount(series);↵

2

                    int itemCount = dataset.getItemCount(series);↵

3

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

3

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

4

                        double lvalue = ixyd.getStartYValue(series, item);↵

4

                        double lvalue = ohlc.getLowValue(series, item);↵

5

                        double uvalue = ixyd.getEndYValue(series, item);↵

5

                        double uvalue = ohlc.getHighValue(series, item);↵

6

                        if (!Double.isNaN(lvalue)) {↵

6

                        if (!Double.isNaN(lvalue)) {↵

7

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

7

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

8

                        }↵

8

                        }↵

9

                        if (!Double.isNaN(uvalue)) {↵

9

                        if (!Double.isNaN(uvalue)) {↵

10

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

10

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

11

                        }↵

11

                        }↵

12

                    }↵

12

                    }↵

13

                }

13

                }

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

1. {Non-refactorable}

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

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

   6

       for (int series = 0; series < seriesCount; series++)

   17

       for (int series = 0; series < seriesCount; series++)

   7

       int itemCount = dataset.getItemCount(series);

   18

       int itemCount = dataset.getItemCount(series);

   8

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

   19

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

   9

       double lvalue = ixyd.getStartYValue(series, item);

   9 | double lvalue = ixyd.getStartYValue(series, item);

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

   10

       double uvalue = ixyd.getEndYValue(series, item);

   10 | double uvalue = ixyd.getEndYValue(series, item);

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

   20 | double lvalue = ohlc.getLowValue(series, item);

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

   20

       double lvalue = ohlc.getLowValue(series, item);

   21 | double uvalue = ohlc.getHighValue(series, item);

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

   21

       double uvalue = ohlc.getHighValue(series, item);

   11

       if (!Double.isNaN(lvalue))

   22

       if (!Double.isNaN(lvalue))

   12

       minimum = Math.min(minimum, lvalue);

   23

       minimum = Math.min(minimum, lvalue);

   13

       if (!Double.isNaN(uvalue))

   24

       if (!Double.isNaN(uvalue))

   14

       maximum = Math.max(maximum, uvalue);

   25

       maximum = Math.max(maximum, uvalue);

   Precondition Violations (5)
   Row | Violation
   --- | ---
   1 | Unmatched statement double lvalue=ixyd.getStartYValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   2 | Unmatched statement double uvalue=ixyd.getEndYValue(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 double lvalue=ohlc.getLowValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   4 | Unmatched statement double uvalue=ohlc.getHighValue(series,item); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
   5 | Clone fragment #1 returns variables series, item, minimum, maximum , while Clone fragment #2 returns variables series, item, minimum, maximum