File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYIntervalSeriesCollectionTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYSeriesCollectionTests.java | |||
Method name: void testRemoveSeries()
|
Method name: void testRemoveSeries()
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | XYIntervalSeriesCollection c = new XYIntervalSeriesCollection();↵ | 1 | XYSeriesCollection c = new XYSeriesCollection();↵ | |
2 | XYIntervalSeries s1 = new XYIntervalSeries("s1");↵ | 2 | XYSeries s1 = new XYSeries("s1");↵ | |
3 | c.addSeries(s1);↵ | 3 | c.addSeries(s1);↵ | |
4 | c.removeSeries(0);↵ | 4 | c.removeSeries(0);↵ | |
5 | assertEquals(0, c.getSeriesCount());↵ | 5 | assertEquals(0, c.getSeriesCount());↵ | |
6 | c.addSeries(s1);↵ | 6 | c.addSeries(s1);↵ | |
7 | boolean pass = false;↵ | 7 | boolean pass = false;↵ | |
8 | try {↵ | 8 | try {↵ | |
9 | c.removeSeries(-1);↵ | 9 | c.removeSeries(-1);↵ | |
10 | }↵ | 10 | }↵ | |
11 | catch (IllegalArgumentException e) {↵ | 11 | catch (IllegalArgumentException e) {↵ | |
12 | pass = true;↵ | 12 | pass = true;↵ | |
13 | }↵ | 13 | }↵ | |
14 | assertTrue(pass);↵ | 14 | assertTrue(pass);↵ | |
15 | pass = false;↵ | 15 | pass = false;↵ | |
16 | try {↵ | 16 | try {↵ | |
17 | c.removeSeries(1);↵ | 17 | c.removeSeries(1);↵ | |
18 | }↵ | 18 | }↵ | |
19 | catch (IllegalArgumentException e) {↵ | 19 | catch (IllegalArgumentException e) {↵ | |
20 | pass = true;↵ | 20 | pass = true;↵ | |
21 | }↵ | 21 | }↵ | |
22 | assertTrue(pass); | 22 |
| |
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 | 43 |
Number of mapped statements | 14 |
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) | 66.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | XYIntervalSeriesCollection c = new XYIntervalSeriesCollection(); |
| 1 | XYSeriesCollection c = new XYSeriesCollection(); | ||||||||||||||||||
2 | XYIntervalSeries s1 = new XYIntervalSeries("s1"); |
| 2 | XYSeries s1 = new XYSeries("s1"); | ||||||||||||||||||
3 | c.addSeries(s1); |
| 3 | c.addSeries(s1); | ||||||||||||||||||
4 | c.removeSeries(0); |
| 4 | c.removeSeries(0); | ||||||||||||||||||
5 | assertEquals(0, c.getSeriesCount()); |
| 5 | assertEquals(0, c.getSeriesCount()); | ||||||||||||||||||
6 | c.addSeries(s1); |
| 6 | c.addSeries(s1); | ||||||||||||||||||
7 | boolean pass = false; | 7 | boolean pass = false; | |||||||||||||||||||
8 | try | 8 | try | |||||||||||||||||||
9 | c.removeSeries(-1); |
| 9 | c.removeSeries(-1); | ||||||||||||||||||
10 | assertTrue(pass); | 10 | assertTrue(pass); | |||||||||||||||||||
11 | pass = false; | 11 | pass = false; | |||||||||||||||||||
12 | try | 12 | try | |||||||||||||||||||
13 | c.removeSeries(1); |
| 13 | c.removeSeries(1); | ||||||||||||||||||
14 | assertTrue(pass); | 14 | assertTrue(pass); |
Row | Violation |
---|---|
1 | Expression new XYIntervalSeriesCollection() 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 XYSeries("s1") cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | 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.xy.XYIntervalSeries) |
5 | Expression c 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.xy.XYIntervalSeries) , public void addSeries(org.jfree.data.xy.XYSeries) |
6 | Expression c cannot be unified with expression c , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void removeSeries(int) |
7 | 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.xy.XYIntervalSeries) |
8 | Expression c 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.xy.XYIntervalSeries) , public void addSeries(org.jfree.data.xy.XYSeries) |
9 | Expression c cannot be unified with expression c , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void removeSeries(int) |
10 | Expression c cannot be unified with expression c , because common superclass org.jfree.data.xy.AbstractIntervalXYDataset does not declare member(s) public void removeSeries(int) |