File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/LogAxisTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/axis/junit/NumberAxisTests.java | |||
Method name: void testAutoRange1()
|
Method name: void testAutoRange1()
|
|||
Number of AST nodes: 9 | Number of AST nodes: 8 | |||
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.createBarChart(↵ | |
5 | "Test",↵ | 5 | "Test", ↵ | |
6 | "Categories",↵ | 6 | "Categories",↵ | |
7 | "Value",↵ | 7 | "Value",↵ | |
8 | dataset,↵ | 8 | dataset,↵ | |
9 | PlotOrientation.VERTICAL,↵ | 9 | PlotOrientation.VERTICAL,↵ | |
10 | false,↵ | 10 | false, ↵ | |
11 | false,↵ | 11 | false,↵ | |
12 | false↵ | 12 | false↵ | |
13 | );↵ | 13 | );↵ | |
14 | CategoryPlot plot = (CategoryPlot) chart.getPlot();↵ | 14 | CategoryPlot plot = (CategoryPlot) chart.getPlot();↵ | |
15 | LogAxis axis = new LogAxis("Log(Y)");↵ | 15 | NumberAxis axis = ↵ | |
16 | plot.setRangeAxis(axis);↵ | 16 | (NumberAxis) plot.getRangeAxis();↵ | |
17 | assertEquals(0.0, axis.getLowerBound(), EPSILON);↵ | 17 | assertEquals(axis.getLowerBound(), 0.0, EPSILON); ↵ | |
18 | assertEquals(2.6066426411261268E7, axis.getUpperBound(), EPSILON); | 18 | assertEquals(axis.getUpperBound(), 210.0, EPSILON); | |
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.0 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 48 |
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 2 |
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.createBarChart("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 | LogAxis axis = new LogAxis("Log(Y)"); |
| | ||||||||||||||||
7 | plot.setRangeAxis(axis); |
| | ||||||||||||||||
8 | assertEquals(0.0, axis.getLowerBound(), EPSILON); |
| 8 | assertEquals(axis.getUpperBound(), 210.0, EPSILON); | |||||||||||||||
9 | assertEquals(2.6066426411261268E7, axis.getUpperBound(), EPSILON); |
| 7 | assertEquals(axis.getLowerBound(), 0.0, EPSILON); |
Row | Violation |
---|---|
1 | Unmatched statement NumberAxis axis=(NumberAxis)plot.getRangeAxis(); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Unmatched statement LogAxis axis=new LogAxis("Log(Y)"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement plot.setRangeAxis(axis); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
4 | Expression axis.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression axis.getLowerBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression axis.getLowerBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression axis.getUpperBound() cannot be parameterized, because it has dependencies to/from statements that will be extracted |