File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/VectorSeriesTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XIntervalSeriesTests.java | |||
Method name: void testCloning()
|
Method name: void testCloning()
|
|||
Number of AST nodes: 8 | Number of AST nodes: 8 | |||
1 | VectorSeries s1 = new VectorSeries("s1");↵ | 1 | XIntervalSeries s1 = new XIntervalSeries("s1");↵ | |
2 | s1.add(1.0, 0.5, 1.5, 2.0);↵ | 2 | s1.add(1.0, 0.5, 1.5, 2.0);↵ | |
3 | VectorSeries s2 = null;↵ | 3 | XIntervalSeries s2 = null;↵ | |
4 | try {↵ | 4 | try {↵ | |
5 | s2 = (VectorSeries) s1.clone();↵ | 5 | s2 = (XIntervalSeries) s1.clone();↵ | |
6 | }↵ | 6 | }↵ | |
7 | catch (CloneNotSupportedException e) {↵ | 7 | catch (CloneNotSupportedException e) {↵ | |
8 | e.printStackTrace();↵ | 8 | e.printStackTrace();↵ | |
9 | }↵ | 9 | }↵ | |
10 | assertTrue(s1 != s2);↵ | 10 | assertTrue(s1 != s2);↵ | |
11 | assertTrue(s1.getClass() == s2.getClass());↵ | 11 | assertTrue(s1.getClass() == s2.getClass());↵ | |
12 | assertTrue(s1.equals(s2)); | 12 |
| |
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.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 24 |
Number of mapped statements | 8 |
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) | 20.7 |
Clone type | Type 2 |
ID | Statement | ID | Statement | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | VectorSeries s1 = new VectorSeries("s1"); |
| 1 | XIntervalSeries s1 = new XIntervalSeries("s1"); | ||||||||||||||||||
2 | s1.add(1.0, 0.5, 1.5, 2.0); |
| 2 | s1.add(1.0, 0.5, 1.5, 2.0); | ||||||||||||||||||
3 | VectorSeries s2 = null; |
| 3 | XIntervalSeries s2 = null; | ||||||||||||||||||
4 | try | 4 | try | |||||||||||||||||||
5 | s2 = (VectorSeries)s1.clone(); |
| 5 | s2 = (XIntervalSeries)s1.clone(); | ||||||||||||||||||
6 | assertTrue(s1 != s2); |
| 6 | assertTrue(s1 != s2); | ||||||||||||||||||
7 | assertTrue(s1.getClass() == s2.getClass()); |
| 7 | assertTrue(s1.getClass() == s2.getClass()); | ||||||||||||||||||
8 | assertTrue(s1.equals(s2)); |
| 8 | assertTrue(s1.equals(s2)); |
Row | Violation |
---|---|
1 | Expression s1 cannot be unified with expression s1 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(double, double, double, double) |
2 | Expression (VectorSeries)s1.clone() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression (XIntervalSeries)s1.clone() cannot be parameterized, because it has dependencies to/from statements that will be extracted |