114-3-10

DefaultBoxAndWhiskerCategoryDataset d1 = new DefaultBoxAndWhiskerCategoryDataset(); d1.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0), new Double(3.0), new Double(4.0), new Double(5.0), new Double(6.0), new Double(7.0), new Double(8.0), new ArrayList()), "ROW1", "COLUMN1"); DefaultBoxAndWhiskerCategoryDataset d2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(d1); out.close(); ObjectInput in = new ObjectInputStream(new ByteArrayInputStream( buffer.toByteArray())); d2 = (DefaultBoxAndWhiskerCategoryDataset) in.readObject(); in.close(); } catch (Exception e) { e.printStackTrace(); } assertEquals(d1, d2);
CompositeTitle t1 = new CompositeTitle(new BlockContainer()); t1.getContainer().add(new TextTitle("T1")); CompositeTitle t2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(t1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray()) ); t2 = (CompositeTitle) in.readObject(); in.close(); } catch (Exception e) { System.out.println(e.toString()); } assertEquals(t1, t2);

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/data/statistics/junit/DefaultBoxAndWhiskerCategoryDatasetTests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/chart/title/junit/CompositeTitleTests.java
Method name: `void testSerialization()` |  | Method name: `void testSerialization()`
Number of AST nodes: 12 |  | Number of AST nodes: 12

1

    DefaultBoxAndWhiskerCategoryDataset d1 ↵

2

                    = new DefaultBoxAndWhiskerCategoryDataset();↵

3

            d1.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0), ↵

4

                    new Double(3.0), new Double(4.0), new Double(5.0), ↵

5

                    new Double(6.0), new Double(7.0), new Double(8.0),↵

6

                    new ArrayList()), "ROW1", "COLUMN↵

1

    CompositeTitle t1 = new CompositeTitle(new BlockContainer());↵

7

    1");↵

2

            t1.getContainer().add(new TextTitle("T1"));↵

8

            DefaultBoxAndWhiskerCategoryDataset d2 = null;↵

3

            CompositeTitle t2 = null;↵

9

            ↵

10

            try {↵

4

            try {↵

11

                ByteArrayOutputStream buffer = new ByteArrayOutputStream();↵

5

                ByteArrayOutputStream buffer = new ByteArrayOutputStream();↵

12

                ObjectOutput out = new ObjectOutputStream(buffer);↵

6

                ObjectOutput out = new ObjectOutputStream(buffer);↵

13

                out.writeObject(d1);↵

7

                out.writeObject(t1);↵

14

                out.close();↵

8

                out.close();↵

15

                ObjectInput in = new ObjectInputStream(↵

9

                ObjectInput in = new ObjectInputStream(↵

16

    new ByteArrayInputStream(↵

10

                    new ByteArrayInputStream(↵

17

                        buffer.toByteArray())↵

11

    buffer.toByteArray())↵

18

    );↵

12

                );↵

19

                d2 = (DefaultBoxAndWhiskerCategoryDataset) in.readObject();↵

13

                t2 = (CompositeTitle) in.readObject();↵

20

                in.close();↵

14

                in.close();↵

21

            }↵

15

            }↵

22

            catch (Exception e) {↵

16

            catch (Exception e) {↵

23

                e.printStackTrace();↵

17

                System.out.println(e.toString());↵

24

            }↵

18

            }↵

25

            assertEquals(d1, d2);

19

            assertEquals(t1, t2);

See real code fragment |  | See real code fragment

Summary
Number of common nesting structure subtrees | 0
Number of refactorable cases | 0
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 | 1