CustomPieURLGenerator g1 = new CustomPieURLGenerator(); CustomPieURLGenerator g2 = new CustomPieURLGenerator(); assertTrue(g1.equals(g2)); Map m1 = new HashMap(); m1.put("A", "http://www.jfree.org/"); g1.addURLs(m1); assertFalse(g1.equals(g2)); g2.addURLs(m1); assertTrue(g1.equals(g2));
DefaultTableXYDataset d1 = new DefaultTableXYDataset(); DefaultTableXYDataset d2 = new DefaultTableXYDataset(); assertTrue(d1.equals(d2)); assertTrue(d2.equals(d1)); d1.addSeries(createSeries1()); assertFalse(d1.equals(d2)); d2.addSeries(createSeries1()); assertTrue(d1.equals(d2));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/urls/junit/CustomPieURLGeneratorTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/TableXYDatasetTests.java
Method name: void testEquals() Method name: void testEquals()
Number of AST nodes: 9 Number of AST nodes: 8
1
CustomPieURLGenerator g1 = new CustomPieURLGenerator();
2
        CustomPieURLGenerator g2 = new CustomPieURLGenerator
1
DefaultTableXYDataset d1 = new DefaultTableXYDataset();
3
();
2
        DefaultTableXYDataset d2 = new DefaultTableXYDataset();
4
        assertTrue(g1.equals(g2));
3
        assertTrue(d1.equals(d2));
5
        Map m1 = new HashMap();
4
        
6
        m1.put("A", "http://www.jfree.org/");
5
assertTrue(d2.equals(d1));
7
        g1.addURLs(m1);
6
        d1.addSeries(createSeries1());
8
        assertFalse(g1.equals(g2));
7
        assertFalse(d1.equals(d2));
9
        g2.addURLs(m1);
8
        d2.addSeries(createSeries1());
10
        assertTrue(g1.equals(g2));
9
        assertTrue(d1.equals(d2));
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.0
Clones locationClones are in different classes having the same super class
Number of node comparisons55
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment4
    Number of unmapped statements in the second code fragment3
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    CustomPieURLGenerator g1 = new CustomPieURLGenerator();
    1
    CustomPieURLGenerator g1 = new CustomPieURLGenerator();
    1
    DefaultTableXYDataset d1 = new DefaultTableXYDataset();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    g1d1VARIABLE_NAME_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new CustomPieURLGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultTableXYDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    1
    DefaultTableXYDataset d1 = new DefaultTableXYDataset();
    2
    CustomPieURLGenerator g2 = new CustomPieURLGenerator();
    2
    CustomPieURLGenerator g2 = new CustomPieURLGenerator();
    2
    DefaultTableXYDataset d2 = new DefaultTableXYDataset();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    g2d2VARIABLE_NAME_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new CustomPieURLGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new DefaultTableXYDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2
    DefaultTableXYDataset d2 = new DefaultTableXYDataset();
    3
    assertTrue(g1.equals(g2));
    3
    assertTrue(g1.equals(g2));
    3
    assertTrue(d1.equals(d2));
    Differences
    Expression1Expression2Difference
    g2d2VARIABLE_NAME_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    g1d1VARIABLE_NAME_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression g2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g2 cannot be unified with expression d2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression g2 cannot be unified with expression d2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    Expression g1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g1 cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    3
    assertTrue(d1.equals(d2));
    4
    Map m1 = new HashMap();
    4
    Map m1 = new HashMap();
    Preondition Violations
    Unmatched statement Map m1=new HashMap(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                    
                                                                      
    5
    d1.addSeries(createSeries1());
    Preondition Violations
    Unmatched statement d1.addSeries(createSeries1()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    d1.addSeries(createSeries1());
    5
    m1.put("A", "http://www.jfree.org/");
    5
    m1.put("A", "http://www.jfree.org/");
    Preondition Violations
    Unmatched statement m1.put("A","http://www.jfree.org/"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                  
    6
    g1.addURLs(m1);
    6
    g1.addURLs(m1);
    Preondition Violations
    Unmatched statement g1.addURLs(m1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                        
    7
    assertFalse(g1.equals(g2));
    7
    assertFalse(g1.equals(g2));
    6
    assertFalse(d1.equals(d2));
    Differences
    Expression1Expression2Difference
    g2d2VARIABLE_NAME_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    g1d1VARIABLE_NAME_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression g2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g2 cannot be unified with expression d2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression g2 cannot be unified with expression d2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    Expression g1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g1 cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    6
    assertFalse(d1.equals(d2));
    8
    g2.addURLs(m1);
    8
    g2.addURLs(m1);
    Preondition Violations
    Unmatched statement g2.addURLs(m1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                        
    9
    assertTrue(g1.equals(g2));
    9
    assertTrue(g1.equals(g2));
    4
    assertTrue(d2.equals(d1));
    Differences
    Expression1Expression2Difference
    g2d1VARIABLE_NAME_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    g1d2VARIABLE_NAME_MISMATCH
    org.jfree.chart.urls.CustomPieURLGeneratororg.jfree.data.xy.DefaultTableXYDatasetSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression g2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g2 cannot be unified with expression d1 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression g2 cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    Expression g1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression g1 cannot be unified with expression d2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    4
    assertTrue(d2.equals(d1));
                                                                      
    7
    d2.addSeries(createSeries1());
    Preondition Violations
    Unmatched statement d2.addSeries(createSeries1()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    d2.addSeries(createSeries1());
                                                              
    8
    assertTrue(d1.equals(d2));
    Preondition Violations
    Unmatched statement assertTrue(d1.equals(d2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    assertTrue(d1.equals(d2));
    Precondition Violations (33)
    Row Violation
    1Expression new CustomPieURLGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new DefaultTableXYDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new CustomPieURLGenerator() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new DefaultTableXYDataset() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression g2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression g2 cannot be unified with expression d2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    8Expression g2 cannot be unified with expression d2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    9Expression g1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression g1 cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    12Unmatched statement Map m1=new HashMap(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    13Unmatched statement d1.addSeries(createSeries1()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14Unmatched statement m1.put("A","http://www.jfree.org/"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    15Unmatched statement g1.addURLs(m1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    16Expression g2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    18Expression g2 cannot be unified with expression d2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    19Expression g2 cannot be unified with expression d2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    20Expression g1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    22Expression g1 cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    23Unmatched statement g2.addURLs(m1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    24Expression g2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    25Expression d1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Expression g2 cannot be unified with expression d1 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    27Expression g2 cannot be unified with expression d1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    28Expression g1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Expression d2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30Expression g1 cannot be unified with expression d2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    31Unmatched statement d2.addSeries(createSeries1()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    32Unmatched statement assertTrue(d1.equals(d2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    33Clone fragment #1 returns variables g1, g2 , while Clone fragment #2 returns variables d1, d2