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) {
e.printStackTrace();
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) {
e.printStackTrace();
success = false;
}
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CategoryPlotTests.java
|
|
File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/XYPlotTests.java
|
Method name: void test1654215()
|
|
Method name: void test1654215()
|
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 | chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);↵ | | 5 | chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);↵
|
6 | g2.dispose();↵ | | 6 | g2.dispose();↵
|
7 | success = true;↵ | | 7 | success = true;↵
|
8 | }↵ | | 8 | }↵
|
9 | catch (Exception e) {↵ | | 9 | catch (Exception e) {↵
|
10 | e.printStackTrace();↵ | | 10 | e.printStackTrace();↵
|
11 | success = false;↵ | | 11 | success = false;↵
|
12 | } | | 12 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
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 | 36 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 6 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 2.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
6 | try | | 6 | try |
7 | BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB); | | 7 | BufferedImage image = new BufferedImage(200, 100, BufferedImage.TYPE_INT_RGB); |
8 | Graphics2D g2 = image.createGraphics(); | | 8 | Graphics2D g2 = image.createGraphics(); |
9 | chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null); | | 9 | chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null); |
10 | | | 10 | |
11 | | | 11 | |
Precondition Violations (0)
Row |
Violation |