1129-1-2

if (Double.isNaN(y) && dataset.getY(series, item) == null) { result[4] = getNullYString(); } else { if (ydf != null) { result[4] = ydf.format(new Date((long) y)); } else { result[4] = ynf.format(y); } }
if (Double.isNaN(ys) && intervalDataset.getStartY(series, item) == null) { result[5] = getNullYString(); } else { if (ydf != null) { result[5] = ydf.format(new Date((long) ys)); } else { result[5] = ynf.format(ys); } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/IntervalXYItemLabelGenerator.java |  | File path: /jfreechart-1.0.10/src/org/jfree/chart/labels/IntervalXYItemLabelGenerator.java
Method name: `Object[] createItemArray(XYDataset, int, int)` |  | Method name: `Object[] createItemArray(XYDataset, int, int)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    if (Double.isNaN(y) && d↵

1

    if (Double.isNaN(ys)↵

2

    ataset.getY(series, item) == null) {↵

2

            		&& intervalDataset.getStartY(series, item) == null) {↵

3

                result[4] = getNullYString();↵

3

                result[5] = getNullYString();↵

4

            }↵

4

            }↵

5

            else {↵

5

            else {↵

6

                if (ydf != null) {↵

6

                if (ydf != null) {↵

7

                    result[4] = ydf.format(new Date((long) y));↵

7

                    result[5] = ydf.format(new Date((long) ys));↵

8

                }↵

8

                }↵

9

                else {↵

9

                else {↵

10

                	result[4] = ynf.format(y);↵

10

                	result[5] = ynf.format(ys);↵

11

                }↵

11

                }↵

12

            }

12

            }

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 1
Number of refactorable cases | 1
Number of non-refactorable cases | 0
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3
Clones location | Clones are in the same method
Number of node comparisons | 10

1. {Refactorable}

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

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

   30

       if (ydf != null)

   35

       if (ydf != null)

   31

       result[4] = ydf.format(new Date((long)y));

   31 | result[4] = ydf.format(new Date((long)y));
   36 | result[5] = ydf.format(new Date((long)ys));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   4 | 5 | LITERAL_VALUE_MISMATCH
   y | ys | VARIABLE_NAME_MISMATCH

   36

       result[5] = ydf.format(new Date((long)ys));

       else

       else

   32

       result[4] = ynf.format(y);

   32 | result[4] = ynf.format(y);
   37 | result[5] = ynf.format(ys);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   4 | 5 | LITERAL_VALUE_MISMATCH
   y | ys | VARIABLE_NAME_MISMATCH

   37

       result[5] = ynf.format(ys);

   Precondition Violations (0)
   Row | Violation
   --- | ---