File path: /jfreechart-1.0.10/src/org/jfree/chart/servlet/ServletUtilities.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/servlet/ServletUtilities.java | |||
Method name: String saveChartAsPNG(JFreeChart, int, int, ChartRenderingInfo, HttpSession)
|
Method name: String saveChartAsJPEG(JFreeChart, int, int, ChartRenderingInfo, HttpSession)
|
|||
Number of AST nodes: 11 | Number of AST nodes: 11 | |||
1 | if (chart == null) {↵ | 1 | if (chart == null) {↵ | |
2 | throw new IllegalArgumentException("Null 'chart' argument."); ↵ | 2 | throw new IllegalArgumentException("Null 'chart' argument."); ↵ | |
3 | }↵ | 3 | }↵ | |
4 | ↵ | |||
4 | ServletUtilities.createTempDir();↵ | 5 | ServletUtilities.createTempDir();↵ | |
5 | String prefix = ServletUtilities.tempFilePrefix;↵ | 6 | String prefix = ServletUtilities.tempFilePrefix;↵ | |
6 | if (session == null) {↵ | 7 | if (session == null) {↵ | |
7 | prefix = ServletUtilities.tempOneTimeFilePrefix;↵ | 8 | prefix = ServletUtilities.tempOneTimeFilePrefix; ↵ | |
8 | }↵ | 9 | }↵ | |
9 | File tempFile = File.createTempFile(prefix, ".png", ↵ | 10 | File tempFile = File.createTempFile(prefix, ".jpeg", ↵ | |
10 | new File(System.getProperty("java.io.tmpdir")));↵ | 11 | new File(System.getProperty("java.io.tmpdir")));↵ | |
11 | ChartUtilities.saveChartAsPNG(tempFile, chart, width, height, info);↵ | 12 | ChartUtilities.saveChartAsJPEG(tempFile, chart, width, height, info);↵ | |
12 | if (session != null) {↵ | 13 | if (session != null) {↵ | |
13 | ServletUtilities.registerChartForDeletion(tempFile, session);↵ | 14 | ServletUtilities.registerChartForDeletion(tempFile, session);↵ | |
14 | }↵ | 15 | }↵ | |
15 | return tempFile.getName(); | 16 |
| |
See real code fragment | See real code fragment |
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.5 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 38 |
Number of mapped statements | 11 |
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) | 15.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (chart == null) | 1 | if (chart == null) | |||||||||||||||
2 | throw new IllegalArgumentException("Null 'chart' argument."); | 2 | throw new IllegalArgumentException("Null 'chart' argument."); | |||||||||||||||
3 | ServletUtilities.createTempDir(); | 3 | ServletUtilities.createTempDir(); | |||||||||||||||
4 | String prefix = ServletUtilities.tempFilePrefix; | 4 | String prefix = ServletUtilities.tempFilePrefix; | |||||||||||||||
5 | if (session == null) | 5 | if (session == null) | |||||||||||||||
6 | prefix = ServletUtilities.tempOneTimeFilePrefix; | 6 | prefix = ServletUtilities.tempOneTimeFilePrefix; | |||||||||||||||
7 | File tempFile = File.createTempFile(prefix, ".png", new File(System.getProperty("java.io.tmpdir"))); |
| 7 | File tempFile = File.createTempFile(prefix, ".jpeg", new File(System.getProperty("java.io.tmpdir"))); | ||||||||||||||
8 | ChartUtilities.saveChartAsPNG(tempFile, chart, width, height, info); |
| 8 | ChartUtilities.saveChartAsJPEG(tempFile, chart, width, height, info); | ||||||||||||||
9 | if (session != null) | 9 | if (session != null) | |||||||||||||||
10 | ServletUtilities.registerChartForDeletion(tempFile, session); | 10 | ServletUtilities.registerChartForDeletion(tempFile, session); | |||||||||||||||
11 | return tempFile.getName(); | 11 | return tempFile.getName(); |
Row | Violation |
---|---|
1 | Expression ChartUtilities.saveChartAsPNG(tempFile,chart,width,height,info) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression ChartUtilities.saveChartAsJPEG(tempFile,chart,width,height,info) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression ChartUtilities.saveChartAsPNG(tempFile,chart,width,height,info) is a void method call, and thus it cannot be parameterized |
4 | Expression ChartUtilities.saveChartAsJPEG(tempFile,chart,width,height,info) is a void method call, and thus it cannot be parameterized |