316-2-5

try { DefaultTableXYDataset dataset = new DefaultTableXYDataset(); XYSeries s1 = new XYSeries("Series 1", true, false); s1.add(5.0, 5.0); s1.add(10.0, 15.5); s1.add(15.0, 9.5); s1.add(20.0, 7.5); dataset.addSeries(s1); XYSeries s2 = new XYSeries("Series 2", true, false); s2.add(5.0, 5.0); s2.add(10.0, 15.5); s2.add(15.0, 9.5); s2.add(20.0, 3.5); dataset.addSeries(s2); XYPlot plot = new XYPlot(dataset, new NumberAxis("X"), new NumberAxis("Y"), new XYAreaRenderer2()); JFreeChart chart = new JFreeChart(plot); /* BufferedImage image = */ chart.createBufferedImage(300, 200, null); success = true; } catch (NullPointerException e) { e.printStackTrace(); success = false;
try { DefaultTableXYDataset dataset = new DefaultTableXYDataset(); XYSeries s1 = new XYSeries("Series 1", true, false); s1.add(5.0, 5.0); s1.add(10.0, 15.5); s1.add(15.0, 9.5); s1.add(20.0, 7.5); dataset.addSeries(s1); XYSeries s2 = new XYSeries("Series 2", true, false); s2.add(5.0, 5.0); s2.add(10.0, 15.5); s2.add(15.0, 9.5); s2.add(20.0, 3.5); dataset.addSeries(s2); XYPlot plot = new XYPlot(dataset, new NumberAxis("X"), new NumberAxis("Y"), new XYStepRenderer()); JFreeChart chart = new JFreeChart(plot); /* BufferedImage image = */ chart.createBufferedImage(300, 200, null); success = true; } catch (NullPointerException e) { e.printStackTrace(); success = false;

Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/XYAreaRenderer2Tests.java |  | File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/XYStepRendererTests.java
Method name: `` |  | Method name: ``
Number of AST nodes: 0 |  | Number of AST nodes: 0

1

    try {↵

1

    try {↵

2

                DefaultTableXYDataset dataset = new DefaultTableXYDataset();↵

2

                DefaultTableXYDataset dataset = new DefaultTableXYDataset();↵

3

                XYSeries s1 = new XYSeries("Series 1", true, false);↵

3

                XYSeries s1 = new XYSeries("Series 1", true, false);↵

4

                s1.add(5.0, 5.0);↵

4

                s1.add(5.0, 5.0);↵

5

                s1.add(10.0, 15.5);↵

5

                s1.add(10.0, 15.5);↵

6

                s1.add(15.0, 9.5);↵

6

                s1.add(15.0, 9.5);↵

7

                s1.add(20.0, 7.5);↵

7

                s1.add(20.0, 7.5);↵

8

                dataset.addSeries(s1);↵

8

                dataset.addSeries(s1);↵

9

                XYSeries s2 = new XYSeries("Series 2", true, false);↵

9

                XYSeries s2 = new XYSeries("Series 2", true, false);↵

10

                s2.add(5.0, 5.0);↵

10

                s2.add(5.0, 5.0);↵

11

                s2.add(10.0, 15.5);↵

11

                s2.add(10.0, 15.5);↵

12

                s2.add(15.0, 9.5);↵

12

                s2.add(15.0, 9.5);↵

13

                s2.add(20.0, 3.5);↵

13

                s2.add(20.0, 3.5);↵

14

                dataset.addSeries(s2);↵

14

                dataset.addSeries(s2);↵

15

                XYPlot plot = new XYPlot(dataset,↵

15

                XYPlot plot = new XYPlot(dataset,↵

16

                        new NumberAxis("X"), new NumberAxis("Y"),↵

16

                        new NumberAxis("X"), new NumberAxis("Y"),↵

17

                        new XYAreaRenderer2());↵

17

                        new XYStepRenderer());↵

18

                JFreeChart chart = new JFreeChart(plot);↵

18

                JFreeChart chart = new JFreeChart(plot);↵

19

                /* BufferedImage image = */ chart.createBufferedImage(300, 200,↵

19

                /* BufferedImage image = */ chart.createBufferedImage(300, 200,↵

20

                        null);↵

20

                        null);↵

21

                success = true;↵

21

                success = true;↵

22

            }↵

22

            }↵

23

            catch (NullPointerException e) {↵

23

            catch (NullPointerException e) {↵

24

                e.printStackTrace();↵

24

                e.printStackTrace();↵

25

                success = false;↵

25

                success = false;↵

26

26

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.0
Clones location |
Number of node comparisons | 0