File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/NumberAxisTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/NumberAxisTests.java | |||
Method name: void testAutoRange1()
|
Method name: void testAutoRange2()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 9 | |||
1 | DefaultCategoryDataset dataset = new DefaultCategoryDataset();↵ | 1 | DefaultCategoryDataset dataset = new DefaultCategoryDataset();↵ | |
2 | dataset.setValue(100.0, "Row 1", "Column 1");↵ | 2 | dataset.setValue(100.0, "Row 1", "Column 1");↵ | |
3 | dataset.setValue(200.0, "Row 1", "Column 2");↵ | 3 | dataset.setValue(200.0, "Row 1", "Column 2");↵ | |
4 | JFreeChart chart = ChartFactory.createBarChart(↵ | 4 | JFreeChart chart = ChartFactory.createLineChart(↵ | |
5 | "Test", ↵ | |||
6 | "Categories",↵ | 5 | "Test", "Categories",↵ | |
7 | "Value",↵ | 6 | "Value",↵ | |
8 | dataset,↵ | |||
9 | PlotOrientation.VERTICAL,↵ | |||
10 | false, ↵ | |||
11 | false,↵ | 7 | dataset, PlotOrientation.VERTICAL, false, false,↵ | |
12 | false↵ | 8 | false↵ | |
13 | );↵ | 9 | );↵ | |
14 | CategoryPlot plot = (CategoryPlot) chart.getPlot();↵ | 10 | CategoryPlot plot = (CategoryPlot) chart.getPlot();↵ | |
15 | NumberAxis axis = (NumberAxis) plot.getRangeAxis();↵ | 11 | NumberAxis axis = (NumberAxis) plot.getRangeAxis();↵ | |
12 | axis.setAutoRangeIncludesZero(false);↵ | |||
16 | assertEquals(axis.getLowerBound(), 0.0, EPSILON); ↵ | 13 | assertEquals(axis.getLowerBound(), 95.0, EPSILON); ↵ | |
17 | assertEquals(axis.getUpperBound(), 210.0, EPSILON); | 14 | assertEquals(axis.getUpperBound(), 205.0, EPSILON); | |
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.0 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 45 |
Number of mapped statements | 8 |
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) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | DefaultCategoryDataset dataset = new DefaultCategoryDataset(); | 1 | DefaultCategoryDataset dataset = new DefaultCategoryDataset(); | |||||||||||||
2 | dataset.setValue(100.0, "Row 1", "Column 1"); | 2 | dataset.setValue(100.0, "Row 1", "Column 1"); | |||||||||||||
3 | dataset.setValue(200.0, "Row 1", "Column 2"); | 3 | dataset.setValue(200.0, "Row 1", "Column 2"); | |||||||||||||
4 | JFreeChart chart = ChartFactory.createBarChart("Test", "Categories", "Value", dataset, PlotOrientation.VERTICAL, false, false, false); |
| 4 | JFreeChart chart = ChartFactory.createLineChart("Test", "Categories", "Value", dataset, PlotOrientation.VERTICAL, false, false, false); | ||||||||||||
5 | CategoryPlot plot = (CategoryPlot)chart.getPlot(); | 5 | CategoryPlot plot = (CategoryPlot)chart.getPlot(); | |||||||||||||
6 | NumberAxis axis = (NumberAxis)plot.getRangeAxis(); | 6 | NumberAxis axis = (NumberAxis)plot.getRangeAxis(); | |||||||||||||
|
| 7 | axis.setAutoRangeIncludesZero(false); | |||||||||||||
7 | assertEquals(axis.getLowerBound(), 0.0, EPSILON); |
| 8 | assertEquals(axis.getLowerBound(), 95.0, EPSILON); | ||||||||||||
8 | assertEquals(axis.getUpperBound(), 210.0, EPSILON); |
| 9 | assertEquals(axis.getUpperBound(), 205.0, EPSILON); |
Row | Violation |
---|---|
1 | Expression ChartFactory.createBarChart("Test","Categories","Value",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression ChartFactory.createLineChart("Test","Categories","Value",dataset,PlotOrientation.VERTICAL,false,false,false) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Unmatched statement axis.setAutoRangeIncludesZero(false); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |