File path: /jfreechart-1.0.10/tests/org/jfree/chart/urls/junit/CustomCategoryURLGeneratorTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/urls/junit/CustomXYURLGeneratorTests.java | |||
Method name: void testAddURLSeries()
|
Method name: void testAddURLSeries()
|
|||
Number of AST nodes: 13 | Number of AST nodes: 13 | |||
1 | CustomCategoryURLGenerator g1 = new CustomCategoryURLGenerator();↵ | 1 | CustomXYURLGenerator g1 = new CustomXYURLGenerator();↵ | |
2 | // you can add a null list - it would have been better if this↵ | 2 | // you can add a null list - it would have been better if this↵ | |
3 | // required EMPTY_LIST↵ | 3 | // required EMPTY_LIST↵ | |
4 | g1.addURLSeries(null);↵ | 4 | g1.addURLSeries(null);↵ | |
5 | assertEquals(1, g1.getListCount());↵ | 5 | assertEquals(1, g1.getListCount());↵ | |
6 | assertEquals(0, g1.getURLCount(0));↵ | 6 | assertEquals(0, g1.getURLCount(0));↵ | |
7 | List list1 = new java.util.ArrayList();↵ | 7 | List list1 = new java.util.ArrayList();↵ | |
8 | list1.add("URL1");↵ | 8 | list1.add("URL1");↵ | |
9 | g1.addURLSeries(list1);↵ | 9 | g1.addURLSeries(list1);↵ | |
10 | assertEquals(2, g1.getListCount());↵ | 10 | assertEquals(2, g1.getListCount());↵ | |
11 | assertEquals(0, g1.getURLCount(0));↵ | 11 | assertEquals(0, g1.getURLCount(0));↵ | |
12 | assertEquals(1, g1.getURLCount(1));↵ | 12 | assertEquals(1, g1.getURLCount(1));↵ | |
13 | assertEquals("URL1", g1.getURL(1, 0));↵ | 13 | assertEquals("URL1", g1.getURL(1, 0));↵ | |
14 | // if we modify the original list, it's best if the URL generator is↵ | 14 | // if we modify the original list, it's best if the URL generator is↵ | |
15 | // not affected↵ | 15 | // not affected↵ | |
16 | list1.clear();↵ | 16 | list1.clear();↵ | |
17 | assertEquals("URL1", g1.getURL(1, 0)); | 17 |
| |
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 | 35 |
Number of mapped statements | 13 |
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) | 0.0 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | CustomCategoryURLGenerator g1 = new CustomCategoryURLGenerator(); |
| 1 | CustomXYURLGenerator g1 = new CustomXYURLGenerator(); | ||||||||||||||||
2 | g1.addURLSeries(null); |
| 2 | g1.addURLSeries(null); | ||||||||||||||||
3 | assertEquals(1, g1.getListCount()); |
| 3 | assertEquals(1, g1.getListCount()); | ||||||||||||||||
4 | assertEquals(0, g1.getURLCount(0)); |
| 4 | assertEquals(0, g1.getURLCount(0)); | ||||||||||||||||
5 | List list1 = new java.util.ArrayList(); | 5 | List list1 = new java.util.ArrayList(); | |||||||||||||||||
6 | list1.add("URL1"); | 6 | list1.add("URL1"); | |||||||||||||||||
7 | g1.addURLSeries(list1); |
| 7 | g1.addURLSeries(list1); | ||||||||||||||||
8 | assertEquals(2, g1.getListCount()); |
| 8 | assertEquals(2, g1.getListCount()); | ||||||||||||||||
9 | assertEquals(0, g1.getURLCount(0)); |
| 9 | assertEquals(0, g1.getURLCount(0)); | ||||||||||||||||
10 | assertEquals(1, g1.getURLCount(1)); |
| 10 | assertEquals(1, g1.getURLCount(1)); | ||||||||||||||||
11 | assertEquals("URL1", g1.getURL(1, 0)); |
| 11 | assertEquals("URL1", g1.getURL(1, 0)); | ||||||||||||||||
12 | list1.clear(); | 12 | list1.clear(); | |||||||||||||||||
13 | assertEquals("URL1", g1.getURL(1, 0)); |
| 13 | assertEquals("URL1", g1.getURL(1, 0)); |
Row | Violation |
---|---|
1 | Expression g1 cannot be unified with expression g1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void addURLSeries(List#RAW) |
2 | Expression g1 cannot be unified with expression g1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getListCount() |
3 | Expression g1 cannot be unified with expression g1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getURLCount(int) |
4 | Expression g1 cannot be unified with expression g1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void addURLSeries(List#RAW) |
5 | Expression g1 cannot be unified with expression g1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getListCount() |
6 | Expression g1 cannot be unified with expression g1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getURLCount(int) |
7 | Expression g1 cannot be unified with expression g1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public int getURLCount(int) |
8 | Expression g1 cannot be unified with expression g1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public java.lang.String getURL(int, int) |
9 | Expression g1 cannot be unified with expression g1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public java.lang.String getURL(int, int) |