File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/CompassPlotTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/PolarPlotTests.java | |||
Method name: void testSerialization()
|
Method name: void testSerialization()
|
|||
Number of AST nodes: 14 | Number of AST nodes: 14 | |||
1 | CompassPlot p1 = new CompassPlot(null);↵ | 1 | PolarPlot p1 = new PolarPlot();↵ | |
2 | p1.setRosePaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, ↵ | 2 | p1.setAngleGridlinePaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f,↵ | |
3 | Color.blue));↵ | 3 | 4.0f, Color.blue));↵ | |
4 | p1.setRoseCenterPaint(new GradientPaint(4.0f, 3.0f, Color.red, 2.0f,↵ | 4 | p1.setAngleLabelPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f,↵ | |
5 | 1.0f, Color.green));↵ | 5 | 4.0f, Color.blue));↵ | |
6 | p1.setRoseHighlightPaint(new GradientPaint(4.0f, 3.0f, Color.red, 2.0f,↵ | 6 | p1.setRadiusGridlinePaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f,↵ | |
7 | 1.0f, Color.green));↵ | 7 | 4.0f, Color.blue));↵ | |
8 | CompassPlot p2 = null;↵ | 8 | PolarPlot p2 = null;↵ | |
9 | try {↵ | 9 | try {↵ | |
10 | ByteArrayOutputStream buffer = new ByteArrayOutputStream();↵ | 10 | ByteArrayOutputStream buffer = new ByteArrayOutputStream();↵ | |
11 | ObjectOutput out = new ObjectOutputStream(buffer);↵ | 11 | ObjectOutput out = new ObjectOutputStream(buffer);↵ | |
12 | out.writeObject(p1);↵ | 12 | out.writeObject(p1);↵ | |
13 | out.close();↵ | 13 | out.close();↵ | |
14 | ObjectInput in = new ObjectInputStream(↵ | 14 | ObjectInput in = new ObjectInputStream(↵ | |
15 | new ByteArrayInputStream(buffer.toByteArray()));↵ | 15 | new ByteArrayInputStream(buffer.toByteArray()));↵ | |
16 | p2 = (CompassPlot) in.readObject();↵ | 16 | p2 = (PolarPlot) in.readObject();↵ | |
17 | in.close();↵ | 17 | in.close();↵ | |
18 | }↵ | 18 | }↵ | |
19 | catch (Exception e) {↵ | 19 | catch (Exception e) {↵ | |
20 | e.printStackTrace();↵ | 20 | e.printStackTrace();↵ | |
21 | }↵ | 21 | }↵ | |
22 | assertEquals(p1, p2); | 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.2 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 84 |
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) | 68.3 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | CompassPlot p1 = new CompassPlot(null); |
| 1 | PolarPlot p1 = new PolarPlot(); | |||||||||||||||||||||||||||||||||
2 | p1.setRosePaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue)); |
| 3 | p1.setAngleLabelPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue)); | |||||||||||||||||||||||||||||||||
3 | p1.setRoseCenterPaint(new GradientPaint(4.0f, 3.0f, Color.red, 2.0f, 1.0f, Color.green)); |
| 2 | p1.setAngleGridlinePaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue)); | |||||||||||||||||||||||||||||||||
4 | p1.setRoseHighlightPaint(new GradientPaint(4.0f, 3.0f, Color.red, 2.0f, 1.0f, Color.green)); |
| 4 | p1.setRadiusGridlinePaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue)); | |||||||||||||||||||||||||||||||||
5 | CompassPlot p2 = null; |
| 5 | PolarPlot p2 = null; | |||||||||||||||||||||||||||||||||
6 | try | 6 | try | ||||||||||||||||||||||||||||||||||
7 | ByteArrayOutputStream buffer = new ByteArrayOutputStream(); | 7 | ByteArrayOutputStream buffer = new ByteArrayOutputStream(); | ||||||||||||||||||||||||||||||||||
8 | ObjectOutput out = new ObjectOutputStream(buffer); | 8 | ObjectOutput out = new ObjectOutputStream(buffer); | ||||||||||||||||||||||||||||||||||
9 | out.writeObject(p1); |
| 9 | out.writeObject(p1); | |||||||||||||||||||||||||||||||||
10 | out.close(); | 10 | out.close(); | ||||||||||||||||||||||||||||||||||
11 | ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray())); | 11 | ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray())); | ||||||||||||||||||||||||||||||||||
12 | p2 = (CompassPlot)in.readObject(); |
| 12 | p2 = (PolarPlot)in.readObject(); | |||||||||||||||||||||||||||||||||
13 | in.close(); | 13 | in.close(); | ||||||||||||||||||||||||||||||||||
14 | assertEquals(p1, p2); |
| 14 | assertEquals(p1, p2); |
Row | Violation |
---|---|
1 | Expression new CompassPlot(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new PolarPlot() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new CompassPlot(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new PolarPlot() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression p1.setRosePaint(new GradientPaint(1.0f,2.0f,Color.red,3.0f,4.0f,Color.blue)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression p1.setAngleLabelPaint(new GradientPaint(1.0f,2.0f,Color.red,3.0f,4.0f,Color.blue)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression p1.setRosePaint(new GradientPaint(1.0f,2.0f,Color.red,3.0f,4.0f,Color.blue)) is a void method call, and thus it cannot be parameterized |
8 | Expression p1.setAngleLabelPaint(new GradientPaint(1.0f,2.0f,Color.red,3.0f,4.0f,Color.blue)) is a void method call, and thus it cannot be parameterized |
9 | Expression p1 cannot be unified with expression p1 , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public void setRosePaint(java.awt.Paint) , public void setAngleLabelPaint(java.awt.Paint) |
10 | Expression p1.setRoseCenterPaint(new GradientPaint(4.0f,3.0f,Color.red,2.0f,1.0f,Color.green)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
11 | Expression p1.setAngleGridlinePaint(new GradientPaint(1.0f,2.0f,Color.red,3.0f,4.0f,Color.blue)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression p1.setRoseCenterPaint(new GradientPaint(4.0f,3.0f,Color.red,2.0f,1.0f,Color.green)) is a void method call, and thus it cannot be parameterized |
13 | Expression p1.setAngleGridlinePaint(new GradientPaint(1.0f,2.0f,Color.red,3.0f,4.0f,Color.blue)) is a void method call, and thus it cannot be parameterized |
14 | Expression p1 cannot be unified with expression p1 , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public void setRoseCenterPaint(java.awt.Paint) , public void setAngleGridlinePaint(java.awt.Paint) |
15 | Expression p1.setRoseHighlightPaint(new GradientPaint(4.0f,3.0f,Color.red,2.0f,1.0f,Color.green)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
16 | Expression p1.setRadiusGridlinePaint(new GradientPaint(1.0f,2.0f,Color.red,3.0f,4.0f,Color.blue)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
17 | Expression p1.setRoseHighlightPaint(new GradientPaint(4.0f,3.0f,Color.red,2.0f,1.0f,Color.green)) is a void method call, and thus it cannot be parameterized |
18 | Expression p1.setRadiusGridlinePaint(new GradientPaint(1.0f,2.0f,Color.red,3.0f,4.0f,Color.blue)) is a void method call, and thus it cannot be parameterized |
19 | Expression p1 cannot be unified with expression p1 , because common superclass org.jfree.chart.plot.Plot does not declare member(s) public void setRoseHighlightPaint(java.awt.Paint) , public void setRadiusGridlinePaint(java.awt.Paint) |
20 | Expression (CompassPlot)in.readObject() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
21 | Expression (PolarPlot)in.readObject() cannot be parameterized, because it has dependencies to/from statements that will be extracted |