MultiplePiePlot p1 = new MultiplePiePlot(null); p1.setAggregatedItemsPaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 3.0f, 4.0f, Color.red)); MultiplePiePlot p2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(p1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray()) ); p2 = (MultiplePiePlot) in.readObject(); in.close(); } catch (Exception e) { e.printStackTrace(); } assertEquals(p1, p2);
XYLine3DRenderer r1 = new XYLine3DRenderer(); r1.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue)); XYLine3DRenderer r2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(r1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); r2 = (XYLine3DRenderer) in.readObject(); in.close(); } catch (Exception e) { e.printStackTrace(); } assertEquals(r1, r2);
Clone fragments detected by clone detection tool
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/xy/junit/XYLine3DRendererTests.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
XYLine3DRenderer r1 = new XYLine3DRenderer();
2
        p1.setAggregatedItemsPaint(new GradientPaint(1.0f, 2.0f, Color.yellow,
2
        r1.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.
3
  
3
red, 3.0f, 4.0f,
4
              3.0f, 4.0f, Color.red));
4
                Color.blue));
5
        MultiplePiePlot p2 = null;
5
        XYLine3DRenderer 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 = (XYLine3DRenderer) 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);
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are in different classes having the same super class
Number of node comparisons72
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements12
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)498.3
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    MultiplePiePlot p1 = new MultiplePiePlot(null);
    1
    MultiplePiePlot p1 = new MultiplePiePlot(null);
    1
    XYLine3DRenderer r1 = new XYLine3DRenderer();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    p1r1VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    new MultiplePiePlot(null)new XYLine3DRenderer()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new MultiplePiePlot(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new XYLine3DRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new MultiplePiePlot(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new XYLine3DRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    XYLine3DRenderer r1 = new XYLine3DRenderer();
    2
    p1.setAggregatedItemsPaint(new GradientPaint(1.0f, 2.0f, Color.yellow, 3.0f, 4.0f, Color.red));
    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, 3.0f, 4.0f, Color.blue));
    Differences
    Expression1Expression2Difference
    yellowredVARIABLE_NAME_MISMATCH
    redblueVARIABLE_NAME_MISMATCH
    setAggregatedItemsPaintsetWallPaintMETHOD_INVOCATION_NAME_MISMATCH
    p1r1VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    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
    Expression r1.setWallPaint(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
    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
    Expression r1.setWallPaint(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
    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)
    2
    r1.setWallPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue));
    3
    MultiplePiePlot p2 = null;
    3
    MultiplePiePlot p2 = null;
    3
    XYLine3DRenderer r2 = null;
    Differences
    Expression1Expression2Difference
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    p2r2VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    3
    XYLine3DRenderer 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(p1);
    7
    out.writeObject(r1);
    Differences
    Expression1Expression2Difference
    p1r1VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    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
    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
    p2 = (MultiplePiePlot)in.readObject();
    10
    r2 = (XYLine3DRenderer)in.readObject();
    Differences
    Expression1Expression2Difference
    p2r2VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression (MultiplePiePlot)in.readObject() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression (XYLine3DRenderer)in.readObject() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    r2 = (XYLine3DRenderer)in.readObject();
    11
    in.close();
    11
    in.close();
    12
    assertEquals(p1, p2);
    12
    assertEquals(p1, p2);
    12
    assertEquals(r1, r2);
    Differences
    Expression1Expression2Difference
    p1r1VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    p2r2VARIABLE_NAME_MISMATCH
    org.jfree.chart.plot.MultiplePiePlotorg.jfree.chart.renderer.xy.XYLine3DRendererSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    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)
    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)
    12
    assertEquals(r1, r2);
    Precondition Violations (14)
    Row Violation
    1Expression new MultiplePiePlot(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new XYLine3DRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new MultiplePiePlot(null) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new XYLine3DRenderer() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression 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
    6Expression r1.setWallPaint(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
    7Expression 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
    8Expression r1.setWallPaint(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
    9Expression 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)
    10Expression 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
    11Expression (MultiplePiePlot)in.readObject() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression (XYLine3DRenderer)in.readObject() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression 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)
    14Expression 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)