352-1-2

BoxAndWhiskerItem i1 = 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() ); BoxAndWhiskerItem i2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(i1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray()) ); i2 = (BoxAndWhiskerItem) in.readObject(); in.close(); } catch (Exception e) { System.out.println(e.toString()); } assertEquals(i1, i2);
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);

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

1

    BoxAndWhiskerItem i1 = new BoxAndWhiskerItem(↵

1

    DefaultBoxAndWhisker↵

2

                ↵

2

    CategoryDataset d1 ↵

3

                    = new DefaultBoxAndWhiskerCategoryDataset();↵

3

    new Double(1.0), new Double(2.0), ↵

4

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

4

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

5

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

5

                new Double(5.0), ↵

6

    new Double(5.0), ↵

6

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

7

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

7

                new ArrayList()↵

8

                    new ArrayList()↵

8

            );↵

9

    ), "ROW1", "COLUMN1");↵

9

            BoxAndWhiskerItem i2 = null;↵

10

            DefaultBoxAndWhiskerCategoryDataset d2 = null;↵

10

            ↵

11

            ↵

11

            try {↵

12

            try {↵

12

                ByteArrayOutputStream buffer = new ByteArrayOutputStream();↵

13

                ByteArrayOutputStream buffer = new ByteArrayOutputStream();↵

13

                ObjectOutput out = new ObjectOutputStream(buffer);↵

14

                ObjectOutput out = new ObjectOutputStream(buffer);↵

14

                out.writeObject(i1);↵

15

                out.writeObject(d1);↵

15

                out.close();↵

16

                out.close();↵

16

                ObjectInput in = new ObjectInputStream(↵

17

                ObjectInput in = new ObjectInputStream(↵

17

                    new ByteArrayInputStream(↵

18

    new ByteArrayInputStream(↵

18

    buffer.toByteArray())↵

19

                        buffer.toByteArray())↵

19

                );↵

20

    );↵

20

                i2 = (BoxAndWhiskerItem) in.readObject();↵

21

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

21

                in.close();↵

22

                in.close();↵

22

            }↵

23

            }↵

23

            catch (Exception e) {↵

24

            catch (Exception e) {↵

24

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

25

                e.printStackTrace();↵

25

            }↵

26

            }↵

26

            assertEquals(i1, i2);

27

            assertEquals(d1, d2);

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