File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/xy/junit/AbstractXYItemRendererTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/general/junit/DatasetUtilitiesTests.java | |||
Method name: void testFindDomainBounds()
|
Method name: void testStackedRangeWithMap()
|
|||
Number of AST nodes: 6 | Number of AST nodes: 6 | |||
1 | AbstractXYItemRenderer renderer = new StandardXYItemRenderer();↵ | |||
2 | ↵ | |||
3 | // check the bounds of a simple dataset↵ | |||
4 | XYDataset dataset = createDataset1();↵ | |||
5 | Range r = renderer.findDomain↵ | 1 | CategoryDataset d = createCategoryDataset1();↵ | |
2 | KeyToGroupMap map = new KeyToGroupMap("G0");↵ | |||
3 | map.mapKeyToGroup("R2", "G1");↵ | |||
6 | Bounds(dataset);↵ | 4 | Range r = DatasetUtilities.findStackedRangeBounds(d, map);↵ | |
7 | assertEquals(1.0, r.getLowerBound(), EPSILON);↵ | 5 | assertEquals(0.0, r.getLowerBound(), EPSILON);↵ | |
8 | assertEquals(3.0, r.getUpperBound(), EPSILON);↵ | 6 | assertEquals(9.0, r.getUpperBound(), EPSILON); | |
9 | ↵ | |||
10 | // check that a null dataset returns null bounds↵ | |||
11 | assertTrue(renderer.findDomainBounds(null) == null); | |||
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 | 36 |
Number of mapped statements | 4 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 2 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | AbstractXYItemRenderer renderer = new StandardXYItemRenderer(); |
| | ||||||||||||||||||||
2 | XYDataset dataset = createDataset1(); |
| 1 | CategoryDataset d = createCategoryDataset1(); | |||||||||||||||||||
|
| 2 | KeyToGroupMap map = new KeyToGroupMap("G0"); | ||||||||||||||||||||
|
| 3 | map.mapKeyToGroup("R2", "G1"); | ||||||||||||||||||||
3 | Range r = renderer.findDomainBounds(dataset); |
| 4 | Range r = DatasetUtilities.findStackedRangeBounds(d, map); | |||||||||||||||||||
4 | assertEquals(1.0, r.getLowerBound(), EPSILON); |
| 5 | assertEquals(0.0, r.getLowerBound(), EPSILON); | |||||||||||||||||||
5 | assertEquals(3.0, r.getUpperBound(), EPSILON); |
| 6 | assertEquals(9.0, r.getUpperBound(), EPSILON); | |||||||||||||||||||
6 | assertTrue(renderer.findDomainBounds(null) == null); | |
Row | Violation |
---|---|
1 | Unmatched statement AbstractXYItemRenderer renderer=new StandardXYItemRenderer(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement KeyToGroupMap map=new KeyToGroupMap("G0"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched statement map.mapKeyToGroup("R2","G1"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
4 | Expression renderer.findDomainBounds(dataset) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression DatasetUtilities.findStackedRangeBounds(d,map) cannot be parameterized, because it has dependencies to/from statements that will be extracted |