303-1-2

YIntervalSeries s1 = new YIntervalSeries("S1"); s1.addChangeListener(this); s1.clear(); assertNull(this.lastEvent); assertTrue(s1.isEmpty()); s1.add(1.0, 2.0, 3.0, 4.0); assertFalse(s1.isEmpty()); s1.clear(); assertNotNull(this.lastEvent); assertTrue(s1.isEmpty());
XYIntervalSeries s1 = new XYIntervalSeries("S1"); s1.addChangeListener(this); s1.clear(); assertNull(this.lastEvent); assertTrue(s1.isEmpty()); s1.add(1.0, 2.0, 3.0, 4.0, 5.0, 6.0); assertFalse(s1.isEmpty()); s1.clear(); assertNotNull(this.lastEvent); assertTrue(s1.isEmpty());

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/YIntervalSeriesTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYIntervalSeriesTests.java
Method name: `void testClear()` |  | Method name: `void testClear()`
Number of AST nodes: 10 |  | Number of AST nodes: 10

1

    YIntervalSeries s1 = new YIntervalSeries("S1");↵

1

    XYIntervalSeries s1 = new XYIntervalSeries("S1");↵

2

            s1.addChangeListener(this);↵

2

            s1.addChangeListener(this);↵

3

            s1.clear();↵

3

            s1.clear();↵

4

            assertNull(this.lastEvent);↵

4

            assertNull(this.lastEvent);↵

5

            assertTrue(s1.isEmpty());↵

5

            assertTrue(s1.isEmpty());↵

6

            s1.add(1.0, 2.0, 3.0, 4.0);↵

6

            s1.add(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);↵

7

            assertFalse(s1.isEmpty());↵

7

            assertFalse(s1.isEmpty());↵

8

            s1.clear();↵

8

            s1.clear();↵

9

            assertNotNull(this.lastEvent);↵

9

            assertNotNull(this.lastEvent);↵

10

            assertTrue(s1.isEmpty());

10

            assertTrue(s1.isEmpty());

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

1. {Non-refactorable}

   Mapping Summary
   Number of mapped statements | 10
   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.0
   Clone type | Type 2

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

   1

       YIntervalSeries s1 = new YIntervalSeries("S1");

   1

       XYIntervalSeries s1 = new XYIntervalSeries("S1");

   2

       s1.addChangeListener(this);

   2

       s1.addChangeListener(this);

   3

       s1.clear();

   3

       s1.clear();

   4

       assertNull(this.lastEvent);

   4

       assertNull(this.lastEvent);

   5

       assertTrue(s1.isEmpty());

   5

       assertTrue(s1.isEmpty());

   6

       s1.add(1.0, 2.0, 3.0, 4.0);

   6 | s1.add(1.0, 2.0, 3.0, 4.0);
   6 | s1.add(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);

   Differences
   Expression1 | Expression2 | Difference
   --- | --- | ---
   s1.add(1.0,2.0,3.0,4.0) | s1.add(1.0,2.0,3.0,4.0,5.0,6.0) | ARGUMENT_NUMBER_MISMATCH

   Preondition Violations
   Expression s1.add(1.0,2.0,3.0,4.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression s1.add(1.0,2.0,3.0,4.0,5.0,6.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   Expression s1.add(1.0,2.0,3.0,4.0) is a void method call, and thus it cannot be parameterized
   Expression s1.add(1.0,2.0,3.0,4.0,5.0,6.0) is a void method call, and thus it cannot be parameterized

   6

       s1.add(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);

   7

       assertFalse(s1.isEmpty());

   7

       assertFalse(s1.isEmpty());

   8

       s1.clear();

   8

       s1.clear();

   9

       assertNotNull(this.lastEvent);

   9

       assertNotNull(this.lastEvent);

   10

       assertTrue(s1.isEmpty());

   10

       assertTrue(s1.isEmpty());

   Precondition Violations (4)
   Row | Violation
   --- | ---
   1 | Expression s1.add(1.0,2.0,3.0,4.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   2 | Expression s1.add(1.0,2.0,3.0,4.0,5.0,6.0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
   3 | Expression s1.add(1.0,2.0,3.0,4.0) is a void method call, and thus it cannot be parameterized
   4 | Expression s1.add(1.0,2.0,3.0,4.0,5.0,6.0) is a void method call, and thus it cannot be parameterized