BlockContainer c1 = new BlockContainer(new FlowArrangement()); BlockContainer c2 = new BlockContainer(new FlowArrangement()); assertTrue(c1.equals(c2)); assertTrue(c2.equals(c2)); c1.setArrangement(new ColumnArrangement()); assertFalse(c1.equals(c2)); c2.setArrangement(new ColumnArrangement()); assertTrue(c1.equals(c2)); c1.add(new EmptyBlock(1.2, 3.4)); assertFalse(c1.equals(c2)); c2.add(new EmptyBlock(1.2, 3.4)); assertTrue(c1.equals(c2));
XYSeries s1 = new XYSeries("Series"); s1.add(1.0, 1.1); XYSeriesCollection c1 = new XYSeriesCollection(); c1.addSeries(s1); XYSeries s2 = new XYSeries("Series"); s2.add(1.0, 1.1); XYSeriesCollection c2 = new XYSeriesCollection(); c2.addSeries(s2); assertTrue(c1.equals(c2)); assertTrue(c2.equals(c1)); c1.addSeries(new XYSeries("Empty Series")); assertFalse(c1.equals(c2)); c2.addSeries(new XYSeries("Empty Series")); assertTrue(c1.equals(c2));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/block/junit/BlockContainerTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/xy/junit/XYSeriesCollectionTests.java
Method name: void testEquals() Method name: void testEquals()
Number of AST nodes: 12 Number of AST nodes: 14
1
BlockContainer c1 = new BlockContainer(new FlowArrangement());
2
        BlockContainer
1
XYSeries s1 = new XYSeries("Series");
2
        s1.add(1.0, 1.1);
3
 c2 = new BlockContainer(new FlowArrangement());
3
        XYSeriesCollection c1 = new 
4
        assertTrue(c1.equals(c2));
5
        assertTrue(c2.equals(c2));
6
        
7
        c1.setArrangement(new ColumnArrangement());
8
        assertFalse(c1.equals(c2)
4
XYSeriesCollection();
5
        c1.addSeries(s1);
6
        XYSeries s2 = new XYSeries("Series");
7
        s2.add(1.0, 1.1);
8
        XYSeriesCollection c2 = new XYSeriesCollection();
9
);
9
        c2.addSeries(s2);
10
        c2.setArrangement(new ColumnArrangement());
10
        assertTrue(c1.equals(c2));
11
        assertTrue(c1.equals(c2));
11
        assertTrue(c2.equals(c1));
12
        
13
        c1.add(new EmptyBlock(1.2, 3.4));
12
        c1.addSeries(new XYSeries("Empty Series"));
14
        assertFalse(c1.equals(c2));
13
        assertFalse(c1.equals(c2));
15
        c2.add(new EmptyBlock(1.2, 3.4));
14
        c2.addSeries(new XYSeries("Empty Series"));
16
        assertTrue(c1.equals(c2));
15
        assertTrue(c1.equals(c2));
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 comparisons106
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment6
    Number of unmapped statements in the second code fragment8
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                                
    1
    XYSeries s1 = new XYSeries("Series");
    Preondition Violations
    Unmatched statement XYSeries s1=new XYSeries("Series"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    XYSeries s1 = new XYSeries("Series");
                                          
    2
    s1.add(1.0, 1.1);
    Preondition Violations
    Unmatched statement s1.add(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    s1.add(1.0, 1.1);
    1
    BlockContainer c1 = new BlockContainer(new FlowArrangement());
    1
    BlockContainer c1 = new BlockContainer(new FlowArrangement());
    3
    XYSeriesCollection c1 = new XYSeriesCollection();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    new BlockContainer(new FlowArrangement())new XYSeriesCollection()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new BlockContainer(new FlowArrangement()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new XYSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new BlockContainer(new FlowArrangement()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new XYSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    XYSeriesCollection c1 = new XYSeriesCollection();
                                            
    4
    c1.addSeries(s1);
    Preondition Violations
    Unmatched statement c1.addSeries(s1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    4
    c1.addSeries(s1);
                                                                                
    5
    XYSeries s2 = new XYSeries("Series");
    Preondition Violations
    Unmatched statement XYSeries s2=new XYSeries("Series"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    XYSeries s2 = new XYSeries("Series");
                                          
    6
    s2.add(1.0, 1.1);
    Preondition Violations
    Unmatched statement s2.add(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6
    s2.add(1.0, 1.1);
    2
    BlockContainer c2 = new BlockContainer(new FlowArrangement());
    2
    BlockContainer c2 = new BlockContainer(new FlowArrangement());
    7
    XYSeriesCollection c2 = new XYSeriesCollection();
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    new BlockContainer(new FlowArrangement())new XYSeriesCollection()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression new BlockContainer(new FlowArrangement()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new XYSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new BlockContainer(new FlowArrangement()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new XYSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7
    XYSeriesCollection c2 = new XYSeriesCollection();
                                            
    8
    c2.addSeries(s2);
    Preondition Violations
    Unmatched statement c2.addSeries(s2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8
    c2.addSeries(s2);
    3
    assertTrue(c1.equals(c2));
    3
    assertTrue(c1.equals(c2));
    10
    assertTrue(c2.equals(c1));
    Differences
    Expression1Expression2Difference
    c2c1VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    c1c2VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression c2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c2 cannot be unified with expression c1 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression c2 cannot be unified with expression c1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    Expression c1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c1 cannot be unified with expression c2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    10
    assertTrue(c2.equals(c1));
                                                                                                  
    11
    c1.addSeries(new XYSeries("Empty Series"));
    Preondition Violations
    Unmatched statement c1.addSeries(new XYSeries("Empty Series")); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11
    c1.addSeries(new XYSeries("Empty Series"));
    4
    assertTrue(c2.equals(c2));
    4
    assertTrue(c2.equals(c2));
    12
    assertFalse(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    c2c1VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    assertTrueassertFalseMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression c2 cannot be unified with expression c2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    Expression c2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression c2 cannot be unified with expression c1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    Expression assertTrue(c2.equals(c2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertFalse(c1.equals(c2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertTrue(c2.equals(c2)) is a void method call, and thus it cannot be parameterized
    Expression assertFalse(c1.equals(c2)) is a void method call, and thus it cannot be parameterized
    12
    assertFalse(c1.equals(c2));
    5
    c1.setArrangement(new ColumnArrangement());
    5
    c1.setArrangement(new ColumnArrangement());
    Preondition Violations
    Unmatched statement c1.setArrangement(new ColumnArrangement()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    6
    assertFalse(c1.equals(c2));
    6
    assertFalse(c1.equals(c2));
    Preondition Violations
    Unmatched statement assertFalse(c1.equals(c2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                
    7
    c2.setArrangement(new ColumnArrangement());
    7
    c2.setArrangement(new ColumnArrangement());
    Preondition Violations
    Unmatched statement c2.setArrangement(new ColumnArrangement()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                                                
    8
    assertTrue(c1.equals(c2));
    8
    assertTrue(c1.equals(c2));
    9
    assertTrue(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression c2 cannot be unified with expression c2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    9
    assertTrue(c1.equals(c2));
    9
    c1.add(new EmptyBlock(1.2, 3.4));
    9
    c1.add(new EmptyBlock(1.2, 3.4));
    Preondition Violations
    Unmatched statement c1.add(new EmptyBlock(1.2,3.4)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                          
    10
    assertFalse(c1.equals(c2));
    10
    assertFalse(c1.equals(c2));
    Preondition Violations
    Unmatched statement assertFalse(c1.equals(c2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                  
    11
    c2.add(new EmptyBlock(1.2, 3.4));
    11
    c2.add(new EmptyBlock(1.2, 3.4));
    Preondition Violations
    Unmatched statement c2.add(new EmptyBlock(1.2,3.4)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                            
                                                                                                  
    13
    c2.addSeries(new XYSeries("Empty Series"));
    Preondition Violations
    Unmatched statement c2.addSeries(new XYSeries("Empty Series")); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    13
    c2.addSeries(new XYSeries("Empty Series"));
    12
    assertTrue(c1.equals(c2));
    12
    assertTrue(c1.equals(c2));
    14
    assertTrue(c1.equals(c2));
    Differences
    Expression1Expression2Difference
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    org.jfree.chart.block.BlockContainerorg.jfree.data.xy.XYSeriesCollectionSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression c2 cannot be unified with expression c2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    14
    assertTrue(c1.equals(c2));
    Precondition Violations (45)
    Row Violation
    1Unmatched statement XYSeries s1=new XYSeries("Series"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement s1.add(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Expression new BlockContainer(new FlowArrangement()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression new XYSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression new BlockContainer(new FlowArrangement()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression new XYSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Unmatched statement c1.addSeries(s1); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    8Unmatched statement XYSeries s2=new XYSeries("Series"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    9Unmatched statement s2.add(1.0,1.1); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10Expression new BlockContainer(new FlowArrangement()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression new XYSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression new BlockContainer(new FlowArrangement()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    13Expression new XYSeriesCollection() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    14Unmatched statement c2.addSeries(s2); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15Expression c2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression c1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    17Expression c2 cannot be unified with expression c1 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    18Expression c2 cannot be unified with expression c1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    19Expression c1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    20Expression c2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    21Expression c1 cannot be unified with expression c2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    22Unmatched statement c1.addSeries(new XYSeries("Empty Series")); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    23Expression c2 cannot be unified with expression c2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    24Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    25Expression c2 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    26Expression c1 cannot be parameterized, because it has dependencies to/from statements that will be extracted
    27Expression c2 cannot be unified with expression c1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    28Expression assertTrue(c2.equals(c2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    29Expression assertFalse(c1.equals(c2)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    30Expression assertTrue(c2.equals(c2)) is a void method call, and thus it cannot be parameterized
    31Expression assertFalse(c1.equals(c2)) is a void method call, and thus it cannot be parameterized
    32Unmatched statement c1.setArrangement(new ColumnArrangement()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    33Unmatched statement assertFalse(c1.equals(c2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    34Unmatched statement c2.setArrangement(new ColumnArrangement()); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    35Expression c2 cannot be unified with expression c2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    36Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    37Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    38Unmatched statement c1.add(new EmptyBlock(1.2,3.4)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    39Unmatched statement assertFalse(c1.equals(c2)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    40Unmatched statement c2.add(new EmptyBlock(1.2,3.4)); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    41Unmatched statement c2.addSeries(new XYSeries("Empty Series")); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    42Expression c2 cannot be unified with expression c2 , because common superclass type org.jfree.util.PublicCloneable cannot be passed as an argument to public boolean equals(java.lang.Object)
    43Expression c2 cannot be unified with expression c2 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    44Expression c1 cannot be unified with expression c1 , because common superclass org.jfree.util.PublicCloneable does not declare member(s) public boolean equals(java.lang.Object)
    45Clone fragment #1 returns variables c1, c2 , while Clone fragment #2 returns variables c1, c2