File path: /jfreechart-1.0.10/tests/org/jfree/chart/plot/junit/MultiplePiePlotTests.java | File path: /jfreechart-1.0.10/tests/org/jfree/chart/renderer/category/junit/BarRenderer3DTests.java | |||
Method name: void testSerialization()
|
Method name: void testSerialization()
|
|||
Number of AST nodes: 12 | Number of AST nodes: 12 | |||
1 | MultiplePiePlot p1 = new MultiplePiePlot(null);↵ | 1 | BarRenderer3D r1 = new BarRenderer3D();↵ | |
2 | p1.setAggregatedItemsPaint(new GradientPaint(1.0f, 2.0f, Color.yellow,↵ | 2 | r1.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.↵ | |
3 | ↵ | 3 | red, 4.0f, 3.0f,↵ | |
4 | 3.0f, 4.0f, Color.red));↵ | 4 | Color.blue));↵ | |
5 | MultiplePiePlot p2 = null;↵ | 5 | BarRenderer3D r2 = 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(r1);↵ | |
10 | out.close();↵ | 10 | out.close();↵ | |
11 | ObjectInput in = new ObjectInputStream(↵ | 11 | ObjectInput in = new ObjectInputStream(↵ | |
12 | new ByteArrayInputStream(buffer.toByteArray())↵ | 12 | new ByteArrayInputStream(buffer.toByteArray())↵ | |
13 | );↵ | 13 | );↵ | |
14 | p2 = (MultiplePiePlot) in.readObject();↵ | 14 | r2 = (BarRenderer3D) in.readObject();↵ | |
15 | in.close();↵ | 15 | in.close();↵ | |
16 | }↵ | 16 | }↵ | |
17 | catch (Exception e) {↵ | 17 | catch (Exception e) {↵ | |
18 | e.printStackTrace();↵ | 18 | e.printStackTrace();↵ | |
19 | }↵ | 19 | }↵ | |
20 | assertEquals(p1, p2); | 20 | assertEquals(r1, r2); | |
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 | 72 |
Number of mapped statements | 12 |
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) | 509.4 |
Clone type | Type 2 |
ID | Statement | ID | Statement | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | MultiplePiePlot p1 = new MultiplePiePlot(null); |
| 1 | BarRenderer3D r1 = new BarRenderer3D(); | |||||||||||||||||||||||||||||||||
2 | p1.setAggregatedItemsPaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 3.0f, 4.0f, Color.red)); |
| 2 | r1.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.red, 4.0f, 3.0f, Color.blue)); | |||||||||||||||||||||||||||||||||
3 | MultiplePiePlot p2 = null; |
| 3 | BarRenderer3D r2 = null; | |||||||||||||||||||||||||||||||||
4 | try | 4 | try | ||||||||||||||||||||||||||||||||||
5 | ByteArrayOutputStream buffer = new ByteArrayOutputStream(); | 5 | ByteArrayOutputStream buffer = new ByteArrayOutputStream(); | ||||||||||||||||||||||||||||||||||
6 | ObjectOutput out = new ObjectOutputStream(buffer); | 6 | ObjectOutput out = new ObjectOutputStream(buffer); | ||||||||||||||||||||||||||||||||||
7 | out.writeObject(p1); |
| 7 | out.writeObject(r1); | |||||||||||||||||||||||||||||||||
8 | out.close(); | 8 | out.close(); | ||||||||||||||||||||||||||||||||||
9 | ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray())); | 9 | ObjectInput in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray())); | ||||||||||||||||||||||||||||||||||
10 | p2 = (MultiplePiePlot)in.readObject(); |
| 10 | r2 = (BarRenderer3D)in.readObject(); | |||||||||||||||||||||||||||||||||
11 | in.close(); | 11 | in.close(); | ||||||||||||||||||||||||||||||||||
12 | assertEquals(p1, p2); |
| 12 | assertEquals(r1, r2); |
Row | Violation |
---|---|
1 | Expression new MultiplePiePlot(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new BarRenderer3D() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression new MultiplePiePlot(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression new BarRenderer3D() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Expression p1.setAggregatedItemsPaint(new GradientPaint(1.0f,2.0f,Color.yellow,3.0f,4.0f,Color.red)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
6 | Expression r1.setWallPaint(new GradientPaint(1.0f,2.0f,Color.red,4.0f,3.0f,Color.blue)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
7 | Expression p1.setAggregatedItemsPaint(new GradientPaint(1.0f,2.0f,Color.yellow,3.0f,4.0f,Color.red)) is a void method call, and thus it cannot be parameterized |
8 | Expression r1.setWallPaint(new GradientPaint(1.0f,2.0f,Color.red,4.0f,3.0f,Color.blue)) is a void method call, and thus it cannot be parameterized |
9 | Expression p1 cannot be unified with expression r1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public void setAggregatedItemsPaint(java.awt.Paint) , public void setWallPaint(java.awt.Paint) |
10 | Expression p1 cannot be unified with expression r1 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public abstract void writeObject(java.lang.Object) throws java.io.IOException |
11 | Expression (MultiplePiePlot)in.readObject() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
12 | Expression (BarRenderer3D)in.readObject() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
13 | Expression p1 cannot be unified with expression r1 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public static void assertEquals(java.lang.Object, java.lang.Object) |
14 | Expression p2 cannot be unified with expression r2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public static void assertEquals(java.lang.Object, java.lang.Object) |