File path: /jfreechart-1.0.10/tests/org/jfree/data/category/junit/DefaultIntervalCategoryDatasetTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/category/junit/DefaultIntervalCategoryDatasetTests.java | |||
Method name: void testSetStartValue()
|
Method name: void testSetEndValue()
|
|||
Number of AST nodes: 17 | Number of AST nodes: 17 | |||
1 | double[] starts_S1 = new double[] {0.1, 0.2, 0.3};↵ | 1 | double[] starts_S1 = new double[] {0.1, 0.2, 0.3};↵ | |
2 | double[] starts_S2 = new double[] {0.3, 0.4, 0.5};↵ | 2 | double[] starts_S2 = new double[] {0.3, 0.4, 0.5};↵ | |
3 | double[] ends_S1 = new double[] {0.5, 0.6, 0.7};↵ | 3 | double[] ends_S1 = new double[] {0.5, 0.6, 0.7};↵ | |
4 | double[] ends_S2 = new double[] {0.7, 0.8, 0.9};↵ | 4 | double[] ends_S2 = new double[] {0.7, 0.8, 0.9};↵ | |
5 | double[][] starts = new double[][] {starts_S1, starts_S2};↵ | 5 | double[][] starts = new double[][] {starts_S1, starts_S2};↵ | |
6 | double[][] ends = new double[][] {ends_S1, ends_S2};↵ | 6 | double[][] ends = new double[][] {ends_S1, ends_S2};↵ | |
7 | DefaultIntervalCategoryDataset d1 = new DefaultIntervalCategoryDataset(↵ | 7 | DefaultIntervalCategoryDataset d1 = new DefaultIntervalCategoryDataset(↵ | |
8 | starts, ends);↵ | 8 | starts, ends);↵ | |
9 | d1.setStartValue(0, "Category 2", new Double(99.9));↵ | 9 | d1.setEndValue(0, "Category 2", new Double(99.9));↵ | |
10 | assertEquals(new Double(99.9), d1.getStartValue("Series 1", ↵ | 10 | assertEquals(new Double(99.9), d1.getEndValue("Series 1", ↵ | |
11 | "Category 2"));↵ | 11 | "Category 2"));↵ | |
12 | ↵ | 12 | ↵ | |
13 | boolean pass = false;↵ | 13 | boolean pass = false;↵ | |
14 | try {↵ | 14 | try {↵ | |
15 | d1.setStartValue(-1, "Category 2", new Double(99.9));↵ | 15 | d1.setEndValue(-1, "Category 2", new Double(99.9));↵ | |
16 | }↵ | 16 | }↵ | |
17 | catch (IllegalArgumentException e) {↵ | 17 | catch (IllegalArgumentException e) {↵ | |
18 | pass = true;↵ | 18 | pass = true;↵ | |
19 | }↵ | 19 | }↵ | |
20 | assertTrue(pass);↵ | 20 | assertTrue(pass);↵ | |
21 | ↵ | 21 | ↵ | |
22 | pass = false;↵ | 22 | pass = false;↵ | |
23 | try {↵ | 23 | try {↵ | |
24 | d1.setStartValue(2, "Category 2", new Double(99.9));↵ | 24 | d1.setEndValue(2, "Category 2", new Double(99.9));↵ | |
25 | }↵ | 25 | }↵ | |
26 | catch (IllegalArgumentException e) {↵ | 26 | catch (IllegalArgumentException e) {↵ | |
27 | pass = true;↵ | 27 | pass = true;↵ | |
28 | }↵ | 28 | }↵ | |
29 | assertTrue(pass); | 29 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 118 |
Number of mapped statements | 17 |
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) | 18.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | double[] starts_S1 = new double[] {0.1, 0.2, 0.3}; | 1 | double[] starts_S1 = new double[] {0.1, 0.2, 0.3}; | |||||||||||||||
2 | double[] starts_S2 = new double[] {0.3, 0.4, 0.5}; | 2 | double[] starts_S2 = new double[] {0.3, 0.4, 0.5}; | |||||||||||||||
3 | double[] ends_S1 = new double[] {0.5, 0.6, 0.7}; | 3 | double[] ends_S1 = new double[] {0.5, 0.6, 0.7}; | |||||||||||||||
4 | double[] ends_S2 = new double[] {0.7, 0.8, 0.9}; | 4 | double[] ends_S2 = new double[] {0.7, 0.8, 0.9}; | |||||||||||||||
5 | double[][] starts = new double[][] {starts_S1, starts_S2}; | 5 | double[][] starts = new double[][] {starts_S1, starts_S2}; | |||||||||||||||
6 | double[][] ends = new double[][] {ends_S1, ends_S2}; | 6 | double[][] ends = new double[][] {ends_S1, ends_S2}; | |||||||||||||||
7 | DefaultIntervalCategoryDataset d1 = new DefaultIntervalCategoryDataset(starts, ends); | 7 | DefaultIntervalCategoryDataset d1 = new DefaultIntervalCategoryDataset(starts, ends); | |||||||||||||||
8 | d1.setStartValue(0, "Category 2", new Double(99.9)); |
| 8 | d1.setEndValue(0, "Category 2", new Double(99.9)); | ||||||||||||||
9 | assertEquals(new Double(99.9), d1.getStartValue("Series 1", "Category 2")); |
| 9 | assertEquals(new Double(99.9), d1.getEndValue("Series 1", "Category 2")); | ||||||||||||||
10 | boolean pass = false; | 10 | boolean pass = false; | |||||||||||||||
11 | try | 11 | try | |||||||||||||||
12 | d1.setStartValue(-1, "Category 2", new Double(99.9)); |
| 12 | d1.setEndValue(-1, "Category 2", new Double(99.9)); | ||||||||||||||
13 | assertTrue(pass); | 13 | assertTrue(pass); | |||||||||||||||
14 | pass = false; | 14 | pass = false; | |||||||||||||||
15 | try | 15 | try | |||||||||||||||
16 | d1.setStartValue(2, "Category 2", new Double(99.9)); |
| 16 | d1.setEndValue(2, "Category 2", new Double(99.9)); | ||||||||||||||
17 | assertTrue(pass); | 17 | assertTrue(pass); |
Row | Violation |
---|---|
1 | Expression d1.setStartValue(0,"Category 2",new Double(99.9)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression d1.setEndValue(0,"Category 2",new Double(99.9)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression d1.setStartValue(0,"Category 2",new Double(99.9)) is a void method call, and thus it cannot be parameterized |
4 | Expression d1.setEndValue(0,"Category 2",new Double(99.9)) is a void method call, and thus it cannot be parameterized |
5 | Expression d1.getStartValue("Series 1","Category 2") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression d1.getEndValue("Series 1","Category 2") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression d1.setStartValue(-1,"Category 2",new Double(99.9)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression d1.setEndValue(-1,"Category 2",new Double(99.9)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression d1.setStartValue(-1,"Category 2",new Double(99.9)) is a void method call, and thus it cannot be parameterized |
10 | Expression d1.setEndValue(-1,"Category 2",new Double(99.9)) is a void method call, and thus it cannot be parameterized |
11 | Expression d1.setStartValue(2,"Category 2",new Double(99.9)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression d1.setEndValue(2,"Category 2",new Double(99.9)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression d1.setStartValue(2,"Category 2",new Double(99.9)) is a void method call, and thus it cannot be parameterized |
14 | Expression d1.setEndValue(2,"Category 2",new Double(99.9)) is a void method call, and thus it cannot be parameterized |