try { BufferedImage image = new BufferedImage(200 , 100, BufferedImage.TYPE_INT_RGB); Graphics2D g2 = image.createGraphics(); this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null); g2.dispose(); success = true; } catch (Exception e) { success = false; }
try { BufferedImage image = new BufferedImage(200 , 100, BufferedImage.TYPE_INT_RGB); Graphics2D g2 = image.createGraphics(); chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null); g2.dispose(); success = true; } catch (Exception e) { success = false; }
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/junit/StackedAreaChartTests.java File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/PiePlot3DTests.java
Method name: void testDrawWithNullInfo() Method name: void testDrawWithNullDataset()
Number of AST nodes: 6 Number of AST nodes: 6
1
try {
1
try {
2
            BufferedImage image = new BufferedImage(200 , 100, 
2
            BufferedImage image = new BufferedImage(200 , 100, 
3
                    BufferedImage.TYPE_INT_RGB);
3
                    BufferedImage.TYPE_INT_RGB);
4
            Graphics2D g2 = image.createGraphics();
4
            Graphics2D g2 = image.createGraphics();
5
            this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, 
5
            chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, 
6
                    null);
6
null);
7
            g2.dispose();
7
            g2.dispose();
8
            success = true;
8
            success = true;
9
        }
9
        }
10
        catch (Exception e) {
10
        catch (Exception e) {
11
          success = false;
11
            success = false;
12
        }
12
        }
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 in different classes having the same super class
Number of node comparisons36
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    try
    3
    try
    3
    BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
    4
    BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB);
    4
    Graphics2D g2 = image.createGraphics();
    5
    Graphics2D g2 = image.createGraphics();
    5
    this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
    5
    this.chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
    6
    chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
    Differences
    Expression1Expression2Difference
    this.chartchartTYPE_COMPATIBLE_REPLACEMENT
    6
    chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
    6
    g2.dispose();
    7
    g2.dispose();
    7
    success = true;
    8
    success = true;
    Precondition Violations (0)
    Row Violation