File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/dial/junit/DialCapTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/dial/junit/StandardDialFrameTests.java | |||
Method name: void testEquals()
|
Method name: void testEquals()
|
|||
Number of AST nodes: 22 | Number of AST nodes: 23 | |||
1 | DialCap c1 = new DialCap();↵ | 1 | StandardDialFrame f1 = new StandardDialFrame();↵ | |
2 | DialCap c2 = new DialCap();↵ | 2 | StandardDialFrame f2 = new StandardDialFrame();↵ | |
3 | assertTrue(c1.equals(c2));↵ | 3 | assertTrue(f1.equals(f2));↵ | |
4 | ↵ | |||
5 | // radius↵ | 4 | // radius↵ | |
6 | c1.setRadius(0.5);↵ | 5 | f1.setRadius(0.2);↵ | |
7 | assertFalse(c1.equals(c2));↵ | 6 | assertFalse(f1.equals(f2));↵ | |
8 | c2.setRadius(0.5);↵ | 7 | f2.setRadius(0.2);↵ | |
9 | assertTrue(c1.equals(c2));↵ | 8 | assertTrue(f1.equals(f2));↵ | |
10 | ↵ | 9 | ↵ | |
11 | // fill paint↵ | 10 | // backgroundPaint↵ | |
12 | c1.setFillPaint(new GradientPaint(1.0f, 2.0f, Color.blue, ↵ | 11 | f1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.white, 3.0f,↵ | |
13 | 3.0f, 4.0f, Color.green));↵ | 12 | 4.0f, Color.yellow));↵ | |
14 | assertFalse(c1.equals(c2));↵ | 13 | assertFalse(f1.equals(f2));↵ | |
15 | c2.setFillPaint(new GradientPaint(1.0f, 2.0f, Color.blue, ↵ | 14 | f2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.white, 3.0f,↵ | |
16 | 3.0f, 4.0f, Color.green↵ | 15 | 4.0f, Color.yellow));↵ | |
17 | ));↵ | 16 | assertTrue(f1.equals(f2));↵ | |
18 | ↵ | 17 | ↵ | |
19 | // outline paint↵ | 18 | // foregroundPaint↵ | |
20 | c1.setOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.white, ↵ | 19 | f1.setForegroundPaint(new GradientPaint(1.0f, 2.0f, Color.blue, 3.0f,↵ | |
21 | 3.0f, 4.0f, Color.gray));↵ | 20 | 4.0f, Color.green));↵ | |
22 | assertFalse(c1.equals(c2));↵ | 21 | assertFalse(f1.equals(f2));↵ | |
23 | c2.setOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.white, ↵ | 22 | f2.setForegroundPaint(new GradientPaint(1.0f, 2.0f, Color.blue, 3.0f,↵ | |
24 | 3.0f, 4.0f, Color.gray));↵ | 23 | 4.0f, Color.green));↵ | |
25 | ↵ | |||
26 | assertTrue(c1.equals(c2));↵ | 24 | assertTrue(f1.equals(f2));↵ | |
25 | ↵ | |||
27 | // outline stroke↵ | 26 | // stroke↵ | |
28 | c1.setOutlineStroke(new BasicStroke(1.1f));↵ | 27 | f1.setStroke(new BasicStroke(2.4f));↵ | |
29 | assertFalse(c1.equals(c2));↵ | 28 | assertFalse(f1.equals(f2));↵ | |
30 | c2.setOutlineStroke(new BasicStroke(1.1f));↵ | 29 | f2.setStroke(new BasicStroke(2.4f));↵ | |
31 | assertTrue(c1.equals(c2));↵ | 30 | assertTrue(f1.equals(f2));↵ | |
32 | ↵ | 31 | ↵ | |
33 | // check an inherited attribute↵ | 32 | // check an inherited attribute↵ | |
34 | c1.setVisible(false);↵ | 33 | f1.setVisible(false);↵ | |
35 | assertFalse(c1.equals(c2));↵ | 34 | assertFalse(f1.equals(f2));↵ | |
36 | c2.setVisible(false);↵ | 35 | f2.setVisible(false);↵ | |
37 | assertTrue(c1.equals(c2)); | 36 | assertTrue(f1.equals(f2)); | |
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 | 163 |
Number of mapped statements | 22 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 3 |
ID | Statement | ID | Statement | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | DialCap c1 = new DialCap(); |
| 1 | StandardDialFrame f1 = new StandardDialFrame(); | ||||||||||||||||||||||||
2 | DialCap c2 = new DialCap(); |
| 2 | StandardDialFrame f2 = new StandardDialFrame(); | ||||||||||||||||||||||||
3 | assertTrue(c1.equals(c2)); |
| 3 | assertTrue(f1.equals(f2)); | ||||||||||||||||||||||||
4 | c1.setRadius(0.5); |
| 4 | f1.setRadius(0.2); | ||||||||||||||||||||||||
5 | assertFalse(c1.equals(c2)); |
| 5 | assertFalse(f1.equals(f2)); | ||||||||||||||||||||||||
6 | c2.setRadius(0.5); |
| 6 | f2.setRadius(0.2); | ||||||||||||||||||||||||
7 | assertTrue(c1.equals(c2)); |
| 7 | assertTrue(f1.equals(f2)); | ||||||||||||||||||||||||
8 | c1.setFillPaint(new GradientPaint(1.0f, 2.0f, Color.blue, 3.0f, 4.0f, Color.green)); |
| 12 | f1.setForegroundPaint(new GradientPaint(1.0f, 2.0f, Color.blue, 3.0f, 4.0f, Color.green)); | ||||||||||||||||||||||||
9 | assertFalse(c1.equals(c2)); |
| 9 | assertFalse(f1.equals(f2)); | ||||||||||||||||||||||||
10 | c2.setFillPaint(new GradientPaint(1.0f, 2.0f, Color.blue, 3.0f, 4.0f, Color.green)); |
| 14 | f2.setForegroundPaint(new GradientPaint(1.0f, 2.0f, Color.blue, 3.0f, 4.0f, Color.green)); | ||||||||||||||||||||||||
11 | c1.setOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.white, 3.0f, 4.0f, Color.gray)); |
| 8 | f1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.white, 3.0f, 4.0f, Color.yellow)); | ||||||||||||||||||||||||
12 | assertFalse(c1.equals(c2)); |
| 13 | assertFalse(f1.equals(f2)); | ||||||||||||||||||||||||
13 | c2.setOutlinePaint(new GradientPaint(1.0f, 2.0f, Color.white, 3.0f, 4.0f, Color.gray)); |
| 10 | f2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.white, 3.0f, 4.0f, Color.yellow)); | ||||||||||||||||||||||||
|
| 11 | assertTrue(f1.equals(f2)); | |||||||||||||||||||||||||
14 | assertTrue(c1.equals(c2)); |
| 15 | assertTrue(f1.equals(f2)); | ||||||||||||||||||||||||
15 | c1.setOutlineStroke(new BasicStroke(1.1f)); |
| 16 | f1.setStroke(new BasicStroke(2.4f)); | ||||||||||||||||||||||||
16 | assertFalse(c1.equals(c2)); |
| 17 | assertFalse(f1.equals(f2)); | ||||||||||||||||||||||||
17 | c2.setOutlineStroke(new BasicStroke(1.1f)); |
| 18 | f2.setStroke(new BasicStroke(2.4f)); | ||||||||||||||||||||||||
18 | assertTrue(c1.equals(c2)); |
| 19 | assertTrue(f1.equals(f2)); | ||||||||||||||||||||||||
19 | c1.setVisible(false); |
| 20 | f1.setVisible(false); | ||||||||||||||||||||||||
20 | assertFalse(c1.equals(c2)); |
| 21 | assertFalse(f1.equals(f2)); | ||||||||||||||||||||||||
21 | c2.setVisible(false); |
| 22 | f2.setVisible(false); | ||||||||||||||||||||||||
22 | assertTrue(c1.equals(c2)); |
| 23 | assertTrue(f1.equals(f2)); |
Row | Violation |
---|---|
1 | Expression new DialCap() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new StandardDialFrame() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new DialCap() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new StandardDialFrame() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression c1 cannot be unified with expression f1 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setRadius(double) |
6 | Expression c2 cannot be unified with expression f2 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setRadius(double) |
7 | Expression c1.setFillPaint(new GradientPaint(1.0f,2.0f,Color.blue,3.0f,4.0f,Color.green)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
8 | Expression f1.setForegroundPaint(new GradientPaint(1.0f,2.0f,Color.blue,3.0f,4.0f,Color.green)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
9 | Expression c1.setFillPaint(new GradientPaint(1.0f,2.0f,Color.blue,3.0f,4.0f,Color.green)) is a void method call, and thus it cannot be parameterized |
10 | Expression f1.setForegroundPaint(new GradientPaint(1.0f,2.0f,Color.blue,3.0f,4.0f,Color.green)) is a void method call, and thus it cannot be parameterized |
11 | Expression c1 cannot be unified with expression f1 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setFillPaint(java.awt.Paint) , public void setForegroundPaint(java.awt.Paint) |
12 | Expression c2.setFillPaint(new GradientPaint(1.0f,2.0f,Color.blue,3.0f,4.0f,Color.green)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression f2.setForegroundPaint(new GradientPaint(1.0f,2.0f,Color.blue,3.0f,4.0f,Color.green)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
14 | Expression c2.setFillPaint(new GradientPaint(1.0f,2.0f,Color.blue,3.0f,4.0f,Color.green)) is a void method call, and thus it cannot be parameterized |
15 | Expression f2.setForegroundPaint(new GradientPaint(1.0f,2.0f,Color.blue,3.0f,4.0f,Color.green)) is a void method call, and thus it cannot be parameterized |
16 | Expression c2 cannot be unified with expression f2 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setFillPaint(java.awt.Paint) , public void setForegroundPaint(java.awt.Paint) |
17 | Expression c1.setOutlinePaint(new GradientPaint(1.0f,2.0f,Color.white,3.0f,4.0f,Color.gray)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
18 | Expression f1.setBackgroundPaint(new GradientPaint(1.0f,2.0f,Color.white,3.0f,4.0f,Color.yellow)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
19 | Expression c1.setOutlinePaint(new GradientPaint(1.0f,2.0f,Color.white,3.0f,4.0f,Color.gray)) is a void method call, and thus it cannot be parameterized |
20 | Expression f1.setBackgroundPaint(new GradientPaint(1.0f,2.0f,Color.white,3.0f,4.0f,Color.yellow)) is a void method call, and thus it cannot be parameterized |
21 | Expression c1 cannot be unified with expression f1 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setOutlinePaint(java.awt.Paint) , public void setBackgroundPaint(java.awt.Paint) |
22 | Expression c2.setOutlinePaint(new GradientPaint(1.0f,2.0f,Color.white,3.0f,4.0f,Color.gray)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
23 | Expression f2.setBackgroundPaint(new GradientPaint(1.0f,2.0f,Color.white,3.0f,4.0f,Color.yellow)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
24 | Expression c2.setOutlinePaint(new GradientPaint(1.0f,2.0f,Color.white,3.0f,4.0f,Color.gray)) is a void method call, and thus it cannot be parameterized |
25 | Expression f2.setBackgroundPaint(new GradientPaint(1.0f,2.0f,Color.white,3.0f,4.0f,Color.yellow)) is a void method call, and thus it cannot be parameterized |
26 | Expression c2 cannot be unified with expression f2 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setOutlinePaint(java.awt.Paint) , public void setBackgroundPaint(java.awt.Paint) |
27 | Unmatched statement assertTrue(f1.equals(f2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
28 | Expression c1.setOutlineStroke(new BasicStroke(1.1f)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
29 | Expression f1.setStroke(new BasicStroke(2.4f)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
30 | Expression c1.setOutlineStroke(new BasicStroke(1.1f)) is a void method call, and thus it cannot be parameterized |
31 | Expression f1.setStroke(new BasicStroke(2.4f)) is a void method call, and thus it cannot be parameterized |
32 | Expression c1 cannot be unified with expression f1 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setOutlineStroke(java.awt.Stroke) , public void setStroke(java.awt.Stroke) |
33 | Expression c2.setOutlineStroke(new BasicStroke(1.1f)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
34 | Expression f2.setStroke(new BasicStroke(2.4f)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
35 | Expression c2.setOutlineStroke(new BasicStroke(1.1f)) is a void method call, and thus it cannot be parameterized |
36 | Expression f2.setStroke(new BasicStroke(2.4f)) is a void method call, and thus it cannot be parameterized |
37 | Expression c2 cannot be unified with expression f2 , because common superclass org.jfree.chart.plot.dial.AbstractDialLayer does not declare member(s) public void setOutlineStroke(java.awt.Stroke) , public void setStroke(java.awt.Stroke) |
38 | Clone fragment #1 returns variables , while Clone fragment #2 returns variables f1, f2 |