275-4-6

XIntervalSeries s1 = new XIntervalSeries("Series1"); XIntervalSeriesCollection dataset = new XIntervalSeriesCollection(); dataset.addSeries(s1); try { /* XYSeries s = */ dataset.getSeries(1); } catch (IllegalArgumentException e) { // correct outcome } catch (IndexOutOfBoundsException e) { assertTrue(false); // wrong outcome }
OHLCSeries s1 = new OHLCSeries("Series1"); OHLCSeriesCollection dataset = new OHLCSeriesCollection(); dataset.addSeries(s1); try { /* XYSeries s = */ dataset.getSeries(1); } catch (IllegalArgumentException e) { // correct outcome } catch (IndexOutOfBoundsException e) { assertTrue(false); // wrong outcome }

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XIntervalSeriesCollectionTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/data/time/ohlc/junit/OHLCSeriesCollectionTests.java
Method name: `void test1170825()` |  | Method name: `void test1170825()`
Number of AST nodes: 5 |  | Number of AST nodes: 5

1

    XIntervalSeries s1 = new XIntervalSeries("Series1");↵

1

    OHLCSeries s1 = new OHLCSeries("Series1");↵

2

            XIntervalSeriesCollection dataset = new XIntervalSeriesCollection();↵

2

            OHLCSeriesCollection dataset = new OHLCSeriesCollection();↵

3

            dataset.addSeries(s1);↵

3

            dataset.addSeries(s1);↵

4

            try {↵

4

            try {↵

5

                /* XYSeries s = */ dataset.getSeries(1);↵

5

                /* XYSeries s = */ dataset.getSeries(1);↵

6

            }↵

6

            }↵

7

            catch (IllegalArgumentException e) {↵

7

            catch (IllegalArgumentException e) {↵

8

                // correct outcome↵

8

                // correct outcome↵

9

            }↵

9

            }↵

10

            catch (IndexOutOfBoundsException e) {↵

10

            catch (IndexOutOfBoundsException e) {↵

11

                assertTrue(false);  // wrong outcome↵

11

                assertTrue(false);  // wrong outcome↵

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.1
Clones location | Clones are in different classes having the same super class
Number of node comparisons | 11

1. {Refactorable}

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

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

   1

       XIntervalSeries s1 = new XIntervalSeries("Series1");

   1 | XIntervalSeries s1 = new XIntervalSeries("Series1");
   1 | OHLCSeries s1 = new OHLCSeries("Series1");

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XIntervalSeries | org.jfree.data.time.ohlc.OHLCSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.XIntervalSeries | org.jfree.data.time.ohlc.OHLCSeries | SUBCLASS_TYPE_MISMATCH
   org.jfree.data.xy.XIntervalSeries | org.jfree.data.time.ohlc.OHLCSeries | SUBCLASS_TYPE_MISMATCH

   1

       OHLCSeries s1 = new OHLCSeries("Series1");

   2

       XIntervalSeriesCollection dataset = new XIntervalSeriesCollection();

   2

       OHLCSeriesCollection dataset = new OHLCSeriesCollection();

   3

       dataset.addSeries(s1);

   3 | dataset.addSeries(s1);
   3 | dataset.addSeries(s1);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   org.jfree.data.xy.XIntervalSeries | org.jfree.data.time.ohlc.OHLCSeries | SUBCLASS_TYPE_MISMATCH

   3

       dataset.addSeries(s1);

   4

       try

   4

       try

   5

       dataset.getSeries(1);

   5

       dataset.getSeries(1);

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