298-1-2

if (column == 0) { return String.class; } else { if (column == 1) { return Double.class; } else { return null; } }
if (column == 0) { return "Period:"; } else { if (column == 1) { return "Value:"; } else { return null; } }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimeSeriesTableModel.java |  | File path: /jfreechart-1.0.10/src/org/jfree/data/time/TimeSeriesTableModel.java
Method name: `Class getColumnClass(int)` |  | Method name: `String getColumnName(int)`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    if (column == 0) {↵

1

    if (column == 0) {↵

2

                return String.class;↵

2

                return "Period:";↵

3

            }↵

3

            }↵

4

            else {↵

4

            else {↵

5

                if (column == 1) {↵

5

                if (column == 1) {↵

6

                    return Double.class;↵

6

                    return "Value:";↵

7

                }↵

7

                }↵

8

                else {↵

8

                else {↵

9

                    return null;↵

9

                    return null;↵

10

                }↵

10

                }↵

11

            }

11

            }

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 declared in the same class
Number of node comparisons | 13

1. {Non-refactorable}

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

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

   1

       if (column == 0)

   1

       if (column == 0)

   2 | return "Period:";

   Preondition Violations
   Unmatched return "Period:";

   2

       return "Period:";

   2

       return String.class;

   2 | return String.class;

   Preondition Violations
   Unmatched return String.class;

       else

       else

   3

       if (column == 1)

   3

       if (column == 1)

   4 | return "Value:";

   Preondition Violations
   Unmatched return "Value:";

   4

       return "Value:";

   4

       return Double.class;

   4 | return Double.class;

   Preondition Violations
   Unmatched return Double.class;

       else

       else

   5

       return null;

   5

       return null;

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Unmatched return "Period:";
   2 | Unmatched return String.class;
   3 | Unmatched return "Value:";
   4 | Unmatched return Double.class;