File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartUtilities.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartUtilities.java | |||
Method name: void saveChartAsPNG(File, JFreeChart, int, int, ChartRenderingInfo, boolean, int)
|
Method name: void saveChartAsJPEG(File, float, JFreeChart, int, int, ChartRenderingInfo)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 7 | |||
1 | if (file == null) {↵ | 1 | if (file == null) {↵ | |
2 | throw new IllegalArgumentException("Null 'file' argument.");↵ | 2 | throw new IllegalArgumentException("Null 'file' argument.");↵ | |
3 | }↵ | 3 | }↵ | |
4 | if (chart == null) {↵ | 4 | if (chart == null) {↵ | |
5 | throw new IllegalArgumentException("Null 'chart' argument.");↵ | 5 | throw new IllegalArgumentException("Null 'chart' argument.");↵ | |
6 | }↵ | 6 | }↵ | |
7 | ↵ | |||
7 | OutputStream out = new BufferedOutputStream(new FileOutputStream(↵ | 8 | OutputStream out = new BufferedOutputStream(new FileOutputStream(↵ | |
8 | file));↵ | 9 | file));↵ | |
9 | try {↵ | 10 | try {↵ | |
10 | writeChartAsPNG(out, chart, width, height, info, encodeAlpha, ↵ | 11 | writeChartAsJPEG(out, quality, chart, width, height, info↵ | |
11 | compression);↵ | 12 | );↵ | |
12 | }↵ | 13 | }↵ | |
13 | finally {↵ | 14 | finally {↵ | |
14 | out.close();↵ | 15 | out.close();↵ | |
15 | } | 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.4 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 22 |
Number of mapped statements | 7 |
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) | 7.9 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (file == null) | 1 | if (file == null) | ||||||||||||||||||||||
2 | throw new IllegalArgumentException("Null 'file' argument."); | 2 | throw new IllegalArgumentException("Null 'file' argument."); | ||||||||||||||||||||||
3 | if (chart == null) | 3 | if (chart == null) | ||||||||||||||||||||||
4 | throw new IllegalArgumentException("Null 'chart' argument."); | 4 | throw new IllegalArgumentException("Null 'chart' argument."); | ||||||||||||||||||||||
5 | OutputStream out = new BufferedOutputStream(new FileOutputStream(file)); | 5 | OutputStream out = new BufferedOutputStream(new FileOutputStream(file)); | ||||||||||||||||||||||
6 | try | 6 | try | ||||||||||||||||||||||
7 | writeChartAsPNG(out, chart, width, height, info, encodeAlpha, compression); |
| 7 | writeChartAsJPEG(out, quality, chart, width, height, info); |
Row | Violation |
---|---|
1 | Expression writeChartAsPNG(out,chart,width,height,info,encodeAlpha,compression) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression writeChartAsJPEG(out,quality,chart,width,height,info) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression writeChartAsPNG(out,chart,width,height,info,encodeAlpha,compression) is a void method call, and thus it cannot be parameterized |
4 | Expression writeChartAsJPEG(out,quality,chart,width,height,info) is a void method call, and thus it cannot be parameterized |
5 | Expression writeChartAsPNG(out,chart,width,height,info,encodeAlpha,compression) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression writeChartAsJPEG(out,quality,chart,width,height,info) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression writeChartAsPNG(out,chart,width,height,info,encodeAlpha,compression) is a void method call, and thus it cannot be parameterized |
8 | Expression writeChartAsJPEG(out,quality,chart,width,height,info) is a void method call, and thus it cannot be parameterized |