try { DefaultBoxAndWhiskerCategoryDataset dataset = new DefaultBoxAndWhiskerCategoryDataset(); dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0), new Double(3.0), new Double(4.0), null, new Double(4.5), new Double(-0.5), new Double(5.5), null), "S1", "C1"); CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Category"), new NumberAxis("Value"), new BoxAndWhiskerRenderer()); ChartRenderingInfo info = new ChartRenderingInfo(); JFreeChart chart = new JFreeChart(plot); /* BufferedImage image = */ chart.createBufferedImage(300, 200, info); success = true; } catch (Exception e) { success = false; }
try { DefaultBoxAndWhiskerCategoryDataset dataset = new DefaultBoxAndWhiskerCategoryDataset(); dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0), new Double(3.0), new Double(4.0), new Double(0.5), null, new Double(-0.5), new Double(5.5), null), "S1", "C1"); CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Category"), new NumberAxis("Value"), new BoxAndWhiskerRenderer()); ChartRenderingInfo info = new ChartRenderingInfo(); JFreeChart chart = new JFreeChart(plot); /* BufferedImage image = */ chart.createBufferedImage(300, 200, info); success = true; } catch (Exception e) { success = false; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/category/junit/BoxAndWhiskerRendererTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/category/junit/BoxAndWhiskerRendererTests.java
Method name: void testDrawWithNullMinRegular() Method name: void testDrawWithNullMaxRegular()
Number of AST nodes: 8 Number of AST nodes: 8
1
try {
1
try {
2
            DefaultBoxAndWhiskerCategoryDataset dataset
2
            DefaultBoxAndWhiskerCategoryDataset dataset
3
                    = new DefaultBoxAndWhiskerCategoryDataset();
3
                    = new DefaultBoxAndWhiskerCategoryDataset();
4
            dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0),
4
            dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0),
5
                    new Double(3.0), new Double(4.0), null,
5
                    new Double(3.0), new Double(4.0), new Double(0.5),
6
                    new Double(4.5), new Double(-0.5), new Double(5.5),
6
                    null, new Double(-0.5), new Double(5.5),
7
                    null), "S1", "C1");
7
                    null), "S1", "C1");
8
            CategoryPlot plot = new CategoryPlot(dataset,
8
            CategoryPlot plot = new CategoryPlot(dataset,
9
                    new CategoryAxis("Category"), new NumberAxis("Value"),
9
                    new CategoryAxis("Category"), new NumberAxis("Value"),
10
                    new BoxAndWhiskerRenderer());
10
                    new BoxAndWhiskerRenderer());
11
            ChartRenderingInfo info = new ChartRenderingInfo();
11
            ChartRenderingInfo info = new ChartRenderingInfo();
12
            JFreeChart chart = new JFreeChart(plot);
12
            JFreeChart chart = new JFreeChart(plot);
13
            /* BufferedImage image = */ chart.createBufferedImage(300, 200,
13
            /* BufferedImage image = */ chart.createBufferedImage(300, 200,
14
                    info);
14
                    info);
15
            success = true;
15
            success = true;
16
        }
16
        }
17
        catch (Exception e) {
17
        catch (Exception e) {
18
            success = false;
18
            success = false;
19
        }
19
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons64
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements8
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    2
    try
    3
    DefaultBoxAndWhiskerCategoryDataset dataset = new DefaultBoxAndWhiskerCategoryDataset();
    3
    DefaultBoxAndWhiskerCategoryDataset dataset = new DefaultBoxAndWhiskerCategoryDataset();
    4
    dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0), new Double(3.0), new Double(4.0), null, new Double(4.5), new Double(-0.5), new Double(5.5), null), "S1", "C1");
    4
    dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0), new Double(3.0), new Double(4.0), null, new Double(4.5), new Double(-0.5), new Double(5.5), null), "S1", "C1");
    4
    dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0), new Double(3.0), new Double(4.0), new Double(0.5), null, new Double(-0.5), new Double(5.5), null), "S1", "C1");
    Differences
    Expression1Expression2Difference
    nullnew Double(0.5)TYPE_COMPATIBLE_REPLACEMENT
    new Double(4.5)nullTYPE_COMPATIBLE_REPLACEMENT
    4
    dataset.add(new BoxAndWhiskerItem(new Double(1.0), new Double(2.0), new Double(3.0), new Double(4.0), new Double(0.5), null, new Double(-0.5), new Double(5.5), null), "S1", "C1");
    5
    CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Category"), new NumberAxis("Value"), new BoxAndWhiskerRenderer());
    5
    CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis("Category"), new NumberAxis("Value"), new BoxAndWhiskerRenderer());
    6
    ChartRenderingInfo info = new ChartRenderingInfo();
    6
    ChartRenderingInfo info = new ChartRenderingInfo();
    7
    JFreeChart chart = new JFreeChart(plot);
    7
    JFreeChart chart = new JFreeChart(plot);
    8
    chart.createBufferedImage(300, 200, info);
    8
    chart.createBufferedImage(300, 200, info);
    9
    success = true;
    9
    success = true;
    Precondition Violations (0)
    Row Violation