File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/TimePeriodValuesCollectionTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYSeriesCollectionTests.java | |||
Method name: void testGetSeries()
|
Method name: void testGetSeries()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | TimePeriodValuesCollection c1 = new TimePeriodValuesCollection();↵ | 1 | XYSeriesCollection c = new XYSeriesCollection();↵ | |
2 | TimePeriodValues s1 = new TimePeriodValues("Series 1");↵ | 2 | XYSeries s1 = new XYSeries("s1");↵ | |
3 | c1.addSeries(s1);↵ | 3 | c.addSeries(s1);↵ | |
4 | assertEquals("Series 1", c1.getSeries(0).getKey());↵ | 4 | assertEquals("s1", c.getSeries(0).getKey());↵ | |
5 | ↵ | |||
6 | boolean pass = false;↵ | 5 | boolean pass = false;↵ | |
7 | try {↵ | 6 | try {↵ | |
8 | c1.getSeries(-1);↵ | 7 | c.getSeries(-1);↵ | |
9 | }↵ | 8 | }↵ | |
10 | catch (IllegalArgumentException e) {↵ | 9 | catch (IllegalArgumentException e) {↵ | |
11 | pass = true;↵ | 10 | pass = true;↵ | |
12 | }↵ | 11 | }↵ | |
13 | assertTrue(pass);↵ | 12 | assertTrue(pass);↵ | |
14 | ↵ | |||
15 | pass = false;↵ | 13 | pass = false;↵ | |
16 | try {↵ | 14 | try {↵ | |
17 | c1.getSeries(1);↵ | 15 | c.getSeries(1);↵ | |
18 | }↵ | 16 | }↵ | |
19 | catch (IllegalArgumentException e) {↵ | 17 | catch (IllegalArgumentException e) {↵ | |
20 | pass = true;↵ | 18 | pass = true;↵ | |
21 | }↵ | 19 | }↵ | |
22 | assertTrue(pass); | 20 |
| |
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 in different classes having the same super class |
Number of node comparisons | 31 |
Number of mapped statements | 12 |
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) | 57.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | TimePeriodValuesCollection c1 = new TimePeriodValuesCollection(); |
| 1 | XYSeriesCollection c = new XYSeriesCollection(); | |||||||||||||||||||||
2 | TimePeriodValues s1 = new TimePeriodValues("Series 1"); |
| 2 | XYSeries s1 = new XYSeries("s1"); | |||||||||||||||||||||
3 | c1.addSeries(s1); |
| 3 | c.addSeries(s1); | |||||||||||||||||||||
4 | assertEquals("Series 1", c1.getSeries(0).getKey()); |
| 4 | assertEquals("s1", c.getSeries(0).getKey()); | |||||||||||||||||||||
5 | boolean pass = false; | 5 | boolean pass = false; | ||||||||||||||||||||||
6 | try | 6 | try | ||||||||||||||||||||||
7 | c1.getSeries(-1); |
| 7 | c.getSeries(-1); | |||||||||||||||||||||
8 | assertTrue(pass); | 8 | assertTrue(pass); | ||||||||||||||||||||||
9 | pass = false; | 9 | pass = false; | ||||||||||||||||||||||
10 | try | 10 | try | ||||||||||||||||||||||
11 | c1.getSeries(1); |
| 11 | c.getSeries(1); | |||||||||||||||||||||
12 | assertTrue(pass); | 12 | assertTrue(pass); |
Row | Violation |
---|---|
1 | Expression new TimePeriodValuesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new XYSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new TimePeriodValues("Series 1") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new XYSeries("s1") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression s1 cannot be unified with expression s1 , because common superclass type org.jfree.data.general.Series cannot be passed as an argument to public void addSeries(org.jfree.data.time.TimePeriodValues) |
6 | Expression c1 cannot be unified with expression c , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.TimePeriodValues) , public void addSeries(org.jfree.data.xy.XYSeries) |
7 | Expression c1 cannot be unified with expression c , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public org.jfree.data.time.TimePeriodValues getSeries(int) , public org.jfree.data.xy.XYSeries getSeries(int) |
8 | Expression c1 cannot be unified with expression c , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public org.jfree.data.time.TimePeriodValues getSeries(int) , public org.jfree.data.xy.XYSeries getSeries(int) |
9 | Expression c1 cannot be unified with expression c , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public org.jfree.data.time.TimePeriodValues getSeries(int) , public org.jfree.data.xy.XYSeries getSeries(int) |