1476-3-4

try { this.seriesB.add(new Year(2006), new Integer(202006)); this.seriesB.add(new Year(2007), new Integer(202007)); this.seriesB.add(new Year(2008), new Integer(202008)); } catch (SeriesException e) { System.err.println("Problem creating series."); }
try { this.seriesC.add(new Year(1999), new Integer(301999)); this.seriesC.add(new Year(2000), new Integer(302000)); this.seriesC.add(new Year(2002), new Integer(302002)); } catch (SeriesException e) { System.err.println("Problem creating series."); }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/TimeSeriesTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/TimeSeriesTests.java
Method name: `void setUp()` |  | Method name: `void setUp()`
Number of AST nodes: 4 |  | Number of AST nodes: 4

1

    try {↵

1

    try {↵

2

                this.seriesB.add(new Year(2006), new Integer(202006));↵

2

                this.seriesC.add(new Year(1999), new Integer(301999));↵

3

                this.seriesB.add(new Year(2007), new Integer(202007));↵

3

                this.seriesC.add(new Year(2000), new Integer(302000));↵

4

                this.seriesB.add(new Year(2008), new Integer(202008));↵

4

                this.seriesC.add(new Year(2002), new Integer(302002));↵

5

            }↵

5

            }↵

6

            catch (SeriesException e) {↵

6

            catch (SeriesException e) {↵

7

                System.err.println("Problem creating series.");↵

7

                System.err.println("Problem creating series.");↵

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

1. {Refactorable}

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

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

   10

       try

   15

       try

   11

       this.seriesB.add(new Year(2006), new Integer(202006));

   11 | this.seriesB.add(new Year(2006), new Integer(202006));
   16 | this.seriesC.add(new Year(1999), new Integer(301999));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   2006 | 1999 | LITERAL_VALUE_MISMATCH
   202006 | 301999 | LITERAL_VALUE_MISMATCH
   seriesB | seriesC | VARIABLE_NAME_MISMATCH

   16

       this.seriesC.add(new Year(1999), new Integer(301999));

   12

       this.seriesB.add(new Year(2007), new Integer(202007));

   12 | this.seriesB.add(new Year(2007), new Integer(202007));
   17 | this.seriesC.add(new Year(2000), new Integer(302000));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   2007 | 2000 | LITERAL_VALUE_MISMATCH
   202007 | 302000 | LITERAL_VALUE_MISMATCH
   seriesB | seriesC | VARIABLE_NAME_MISMATCH

   17

       this.seriesC.add(new Year(2000), new Integer(302000));

   13

       this.seriesB.add(new Year(2008), new Integer(202008));

   13 | this.seriesB.add(new Year(2008), new Integer(202008));
   18 | this.seriesC.add(new Year(2002), new Integer(302002));

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   2008 | 2002 | LITERAL_VALUE_MISMATCH
   202008 | 302002 | LITERAL_VALUE_MISMATCH
   seriesB | seriesC | VARIABLE_NAME_MISMATCH

   18

       this.seriesC.add(new Year(2002), new Integer(302002));

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