File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java | File path: /jfreechart-1.0.10/src/org/jfree/chart/ChartFactory.java | |||
Method name: JFreeChart createStackedBarChart(String, String, String, CategoryDataset, PlotOrientation, boolean, boolean, boolean)
|
Method name: JFreeChart createHistogram(String, String, String, IntervalXYDataset, PlotOrientation, boolean, boolean, boolean)
|
|||
Number of AST nodes: 13 | Number of AST nodes: 14 | |||
1 | if (orientation == null) {↵ | 1 | if (orientation == null) {↵ | |
2 | throw new IllegalArgumentException("Null 'orientation' argument.");↵ | 2 | throw new IllegalArgumentException("Null 'orientation' argument.");↵ | |
3 | }↵ | 3 | }↵ | |
4 | CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel↵ | 4 | NumberAxis xAxis = new NumberAxis(xAxisLabel);↵ | |
5 | );↵ | 5 | xAxis.setAutoRangeIncludesZero(false);↵ | |
6 | ValueAxis valueAxis = new NumberAxis(rangeAxisLabel);↵ | 6 | ValueAxis yAxis = new NumberAxis(yAxisLabel);↵ | |
7 | StackedBarRenderer renderer = new StackedBarRenderer();↵ | 7 | XYItemRenderer renderer = new XYBarRenderer();↵ | |
8 | if (tooltips) {↵ | 8 | if (tooltips) {↵ | |
9 | renderer.setBaseToolTipGenerator(↵ | 9 | renderer.setBaseToolTipGenerator(↵ | |
10 | new StandardCategoryToolTipGenerator());↵ | 10 | new StandardXYToolTipGenerator());↵ | |
11 | }↵ | 11 | }↵ | |
12 | if (urls) {↵ | 12 | if (urls) {↵ | |
13 | renderer.setBaseItemURLGenerator(↵ | 13 | renderer.setURLGenerator(↵ | |
14 | new StandardCategoryURLGenerator());↵ | 14 | new StandardXYURLGenerator());↵ | |
15 | }↵ | 15 | }↵ | |
16 | CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, ↵ | 16 | XYPlot plot = new XYPlot(dataset, ↵ | |
17 | renderer);↵ | 17 | xAxis, yAxis, renderer);↵ | |
18 | plot.setOrientation(orientation);↵ | 18 | plot.setOrientation(orientation);↵ | |
19 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,↵ | 19 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,↵ | |
20 | plot, legend);↵ | 20 | plot, legend);↵ | |
21 | return chart; | 21 |
| |
See real code fragment | See real code fragment |
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 41 |
Number of mapped statements | 13 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 604.2 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | if (orientation == null) | 1 | if (orientation == null) | ||||||||||||||||||||||||||||||||||
2 | throw new IllegalArgumentException("Null 'orientation' argument."); | 2 | throw new IllegalArgumentException("Null 'orientation' argument."); | ||||||||||||||||||||||||||||||||||
3 | CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel); |
| 3 | NumberAxis xAxis = new NumberAxis(xAxisLabel); | |||||||||||||||||||||||||||||||||
|
| 4 | xAxis.setAutoRangeIncludesZero(false); | ||||||||||||||||||||||||||||||||||
4 | ValueAxis valueAxis = new NumberAxis(rangeAxisLabel); |
| 5 | ValueAxis yAxis = new NumberAxis(yAxisLabel); | |||||||||||||||||||||||||||||||||
5 | StackedBarRenderer renderer = new StackedBarRenderer(); |
| 6 | XYItemRenderer renderer = new XYBarRenderer(); | |||||||||||||||||||||||||||||||||
6 | if (tooltips) | 7 | if (tooltips) | ||||||||||||||||||||||||||||||||||
7 | renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator()); |
| 8 | renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); | |||||||||||||||||||||||||||||||||
8 | if (urls) | 9 | if (urls) | ||||||||||||||||||||||||||||||||||
9 | renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator()); |
| 10 | renderer.setURLGenerator(new StandardXYURLGenerator()); | |||||||||||||||||||||||||||||||||
10 | CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer); |
| 11 | XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer); | |||||||||||||||||||||||||||||||||
11 | plot.setOrientation(orientation); |
| 12 | plot.setOrientation(orientation); | |||||||||||||||||||||||||||||||||
12 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); |
| 13 | JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); | |||||||||||||||||||||||||||||||||
13 | return chart; | 14 | return chart; |
Row | Violation |
---|---|
1 | Expression new CategoryAxis(domainAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new NumberAxis(xAxisLabel) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement xAxis.setAutoRangeIncludesZero(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Expression new StackedBarRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression new XYBarRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression new StandardCategoryToolTipGenerator() cannot be unified with expression new StandardXYToolTipGenerator() , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public void setBaseToolTipGenerator(org.jfree.chart.labels.CategoryToolTipGenerator) |
7 | Type org.jfree.chart.urls.StandardCategoryURLGenerator does not match with type org.jfree.chart.urls.StandardXYURLGenerator |
8 | Expression renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression renderer.setURLGenerator(new StandardXYURLGenerator()) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
10 | Expression renderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator()) is a void method call, and thus it cannot be parameterized |
11 | Expression renderer.setURLGenerator(new StandardXYURLGenerator()) is a void method call, and thus it cannot be parameterized |
12 | Expression new CategoryPlot(dataset,categoryAxis,valueAxis,renderer) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression new XYPlot(dataset,xAxis,yAxis,renderer) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression plot cannot be unified with expression plot , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public void setOrientation(org.jfree.chart.plot.PlotOrientation) |