1481-1-2

if (getNumberFormat() != null) { result[3] = getNumberFormat().format(start); result[4] = getNumberFormat().format(end); } else if (getDateFormat() != null) { result[3] = getDateFormat().format(start); result[4] = getDateFormat().format(end); }
if (getNumberFormat() != null) { result[3] = getNumberFormat().format(start); result[4] = getNumberFormat().format(end); } else if (getDateFormat() != null) { result[3] = getDateFormat().format(start); result[4] = getDateFormat().format(end); }

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

1

    if (getNumberFormat() != null) {↵

1

    if (getNumberFormat() != null) {↵

2

                    result[3] = getNumberFormat().format(start);  ↵

2

                    result[3] = getNumberFormat().format(start);  ↵

3

                    result[4] = getNumberFormat().format(end);  ↵

3

                    result[4] = getNumberFormat().format(end);  ↵

4

                }↵

4

                }↵

5

                else if (getDateFormat() != null) {↵

5

                else if (getDateFormat() != null) {↵

6

                    result[3] = getDateFormat().format(start);↵

6

                    result[3] = getDateFormat().format(start);↵

7

                    result[4] = getDateFormat().format(end);↵

7

                    result[4] = getDateFormat().format(end);↵

8

                }

8

                }

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 different classes having the same super class
Number of node comparisons | 29

1. {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) | 1.4
   Clone type | Type 1

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

   13

       if (getNumberFormat() != null)

   13

       if (getNumberFormat() != null)

   14

       result[3] = getNumberFormat().format(start);

   14

       result[3] = getNumberFormat().format(start);

   15

       result[4] = getNumberFormat().format(end);

   15

       result[4] = getNumberFormat().format(end);

   16

       else if (getDateFormat() != null)

   16

       else if (getDateFormat() != null)

   17

       result[3] = getDateFormat().format(start);

   17

       result[3] = getDateFormat().format(start);

   18

       result[4] = getDateFormat().format(end);

   18

       result[4] = getDateFormat().format(end);

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