File path: /jfreechart-1.0.10/tests/org/jfree/data/time/ohlc/junit/OHLCSeriesCollectionTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYIntervalSeriesCollectionTests.java | |||
Method name: void testEquals()
|
Method name: void testEquals()
|
|||
Number of AST nodes: 15 | Number of AST nodes: 15 | |||
1 | OHLCSeriesCollection c1 = new OHLCSeriesCollection();↵ | 1 | XYIntervalSeriesCollection c1 = new XYIntervalSeriesCollection();↵ | |
2 | OHLCSeriesCollection c2 = new OHLCSeriesCollection();↵ | 2 | XYIntervalSeriesCollection c2 = new XYIntervalSeriesCollection();↵ | |
3 | assertEquals(c1, c2);↵ | 3 | assertEquals(c1, c2);↵ | |
4 | ↵ | |||
5 | // add a series↵ | 4 | // add a series↵ | |
6 | OHLCSeries s1 = new OHLCSeries("Series");↵ | 5 | XYIntervalSeries s1 = new XYIntervalSeries("Series");↵ | |
7 | s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);↵ | 6 | s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);↵ | |
8 | c1.addSeries(s1);↵ | 7 | c1.addSeries(s1);↵ | |
9 | assertFalse(c1.equals(c2));↵ | 8 | assertFalse(c1.equals(c2));↵ | |
10 | OHLCSeries s2 = new OHLCSeries("Series");↵ | 9 | XYIntervalSeries s2 = new XYIntervalSeries("Series");↵ | |
11 | s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);↵ | 10 | s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5);↵ | |
12 | c2.addSeries(s2);↵ | 11 | c2.addSeries(s2);↵ | |
13 | assertTrue(c1.equals(c2));↵ | 12 | assertTrue(c1.equals(c2));↵ | |
14 | ↵ | |||
15 | // add an empty series↵ | 13 | // add an empty series↵ | |
16 | c1.addSeries(new OHLCSeries("Empty Series"));↵ | 14 | c1.addSeries(new XYIntervalSeries("Empty Series"));↵ | |
17 | assertFalse(c1.equals(c2));↵ | 15 | assertFalse(c1.equals(c2));↵ | |
18 | c2.addSeries(new OHLCSeries("Empty Series"));↵ | 16 | c2.addSeries(new XYIntervalSeries("Empty Series"));↵ | |
19 | assertTrue(c1.equals(c2)); | 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 | 60 |
Number of mapped statements | 15 |
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 | OHLCSeriesCollection c1 = new OHLCSeriesCollection(); |
| 1 | XYIntervalSeriesCollection c1 = new XYIntervalSeriesCollection(); | ||||||||||||||||||
2 | OHLCSeriesCollection c2 = new OHLCSeriesCollection(); |
| 2 | XYIntervalSeriesCollection c2 = new XYIntervalSeriesCollection(); | ||||||||||||||||||
3 | assertEquals(c1, c2); |
| 3 | assertEquals(c1, c2); | ||||||||||||||||||
4 | OHLCSeries s1 = new OHLCSeries("Series"); |
| 4 | XYIntervalSeries s1 = new XYIntervalSeries("Series"); | ||||||||||||||||||
5 | s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3); |
| 5 | s1.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5); | ||||||||||||||||||
6 | c1.addSeries(s1); |
| 6 | c1.addSeries(s1); | ||||||||||||||||||
7 | assertFalse(c1.equals(c2)); |
| 7 | assertFalse(c1.equals(c2)); | ||||||||||||||||||
8 | OHLCSeries s2 = new OHLCSeries("Series"); |
| 8 | XYIntervalSeries s2 = new XYIntervalSeries("Series"); | ||||||||||||||||||
9 | s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3); |
| 9 | s2.add(1.0, 1.1, 1.2, 1.3, 1.4, 1.5); | ||||||||||||||||||
10 | c2.addSeries(s2); |
| 10 | c2.addSeries(s2); | ||||||||||||||||||
11 | assertTrue(c1.equals(c2)); |
| 11 | assertTrue(c1.equals(c2)); | ||||||||||||||||||
12 | c1.addSeries(new OHLCSeries("Empty Series")); |
| 12 | c1.addSeries(new XYIntervalSeries("Empty Series")); | ||||||||||||||||||
13 | assertFalse(c1.equals(c2)); |
| 13 | assertFalse(c1.equals(c2)); | ||||||||||||||||||
14 | c2.addSeries(new OHLCSeries("Empty Series")); |
| 14 | c2.addSeries(new XYIntervalSeries("Empty Series")); | ||||||||||||||||||
15 | assertTrue(c1.equals(c2)); |
| 15 | assertTrue(c1.equals(c2)); |
Row | Violation |
---|---|
1 | Expression new OHLCSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new XYIntervalSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new OHLCSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new XYIntervalSeriesCollection() 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 org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(org.jfree.data.time.RegularTimePeriod, double, double, double, double) , public void add(double, double, double, double, double, double) |
6 | Expression s1.add(new Year(2006),1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression s1.add(new Year(2006),1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized |
9 | Expression s1.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized |
10 | Expression s1 cannot be unified with expression s1 , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) |
11 | Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries) |
12 | Expression s2 cannot be unified with expression s2 , because common superclass org.jfree.data.ComparableObjectSeries does not declare member(s) public void add(org.jfree.data.time.RegularTimePeriod, double, double, double, double) , public void add(double, double, double, double, double, double) |
13 | Expression s2.add(new Year(2006),1.0,1.1,1.2,1.3) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
15 | Expression s2.add(new Year(2006),1.0,1.1,1.2,1.3) is a void method call, and thus it cannot be parameterized |
16 | Expression s2.add(1.0,1.1,1.2,1.3,1.4,1.5) is a void method call, and thus it cannot be parameterized |
17 | Expression s2 cannot be unified with expression s2 , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) |
18 | Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries) |
19 | Expression new OHLCSeries("Empty Series") cannot be unified with expression new XYIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) |
20 | Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries) |
21 | Expression new OHLCSeries("Empty Series") cannot be unified with expression new XYIntervalSeries("Empty Series") , because common superclass type org.jfree.data.ComparableObjectSeries cannot be passed as an argument to public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) |
22 | Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.data.xy.AbstractXYDataset does not declare member(s) public void addSeries(org.jfree.data.time.ohlc.OHLCSeries) , public void addSeries(org.jfree.data.xy.XYIntervalSeries) |