GridArrangement f1 = new GridArrangement(11, 22); GridArrangement f2 = new GridArrangement(11, 22); assertTrue(f1.equals(f2)); assertTrue(f2.equals(f1)); f1 = new GridArrangement(33, 22); assertFalse(f1.equals(f2)); f2 = new GridArrangement(33, 22); assertTrue(f1.equals(f2)); f1 = new GridArrangement(33, 44); assertFalse(f1.equals(f2)); f2 = new GridArrangement(33, 44); assertTrue(f1.equals(f2));
Week w1 = new Week(1, 2002); Week w2 = new Week(1, 2002); assertTrue(w1.equals(w2)); assertTrue(w2.equals(w1)); w1 = new Week(2, 2002); assertFalse(w1.equals(w2)); w2 = new Week(2, 2002); assertTrue(w1.equals(w2)); w1 = new Week(2, 2003); assertFalse(w1.equals(w2)); w2 = new Week(2, 2003); assertTrue(w1.equals(w2));
Clone fragments detected by clone detection tool
File path: /jfreechart-1.0.10/tests/org/jfree/chart/block/junit/GridArrangementTests.java File path: /jfreechart-1.0.10/tests/org/jfree/data/time/junit/WeekTests.java
Method name: void testEquals() Method name: void testEquals()
Number of AST nodes: 12 Number of AST nodes: 12
1
GridArrangement f1 = new GridArrangement(11, 22);
1
Week w1 = new Week(1, 2002);
2
        GridArrangement f2 = new GridArrangement(11, 22);
2
        Week w2 = new Week(1, 2002);
3
        assertTrue(f1.equals(f2));
3
        assertTrue(w1.equals(w2));
4
        assertTrue(f2.equals(f1));
4
        assertTrue(w2.equals(w1));
5
        
5
        f1 = new GridArrangement(33, 22);
6
        w1 = new Week(2, 2002);
6
        assertFalse(f1.equals(f2));
7
        assertFalse(w1.equals(w2));
7
        f2 = new GridArrangement(33, 22);
8
        w2 = new Week(2, 2002);
8
        assertTrue(f1.equals(f2));
9
        assertTrue(w1.equals(w2));
10
        
9
        f1 = new GridArrangement(33, 44);
11
        w1 = new Week(2, 2003);
10
        assertFalse(f1.equals(f2));
12
        assertFalse(w1.equals(w2));
11
        f2 = new GridArrangement(33, 44);
13
        w2 = new Week(2, 2003);
12
        assertTrue(f1.equals(f2));
14
        assertTrue(w1.equals(w2));
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 comparisons62
  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 fragment6
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
                                                            
    1
    Week w1 = new Week(1, 2002);
    Preondition Violations
    Unmatched statement Week w1=new Week(1,2002); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    Week w1 = new Week(1, 2002);
    1
    GridArrangement f1 = new GridArrangement(11, 22);
    1
    GridArrangement f1 = new GridArrangement(11, 22);
    Preondition Violations
    Unmatched statement GridArrangement f1=new GridArrangement(11,22); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                      
                                                            
    2
    Week w2 = new Week(1, 2002);
    Preondition Violations
    Unmatched statement Week w2=new Week(1,2002); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    Week w2 = new Week(1, 2002);
    2
    GridArrangement f2 = new GridArrangement(11, 22);
    2
    GridArrangement f2 = new GridArrangement(11, 22);
    Preondition Violations
    Unmatched statement GridArrangement f2=new GridArrangement(11,22); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                      
    3
    assertTrue(f1.equals(f2));
    3
    assertTrue(f1.equals(f2));
    3
    assertTrue(w1.equals(w2));
    Differences
    Expression1Expression2Difference
    f2w2VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    f1w1VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    3
    assertTrue(w1.equals(w2));
    4
    assertTrue(f2.equals(f1));
    4
    assertTrue(f2.equals(f1));
    4
    assertTrue(w2.equals(w1));
    Differences
    Expression1Expression2Difference
    f1w1VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    f2w2VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    4
    assertTrue(w2.equals(w1));
                                                  
    5
    w1 = new Week(2, 2002);
    Preondition Violations
    Unmatched statement w1=new Week(2,2002); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    5
    w1 = new Week(2, 2002);
    5
    f1 = new GridArrangement(33, 22);
    5
    f1 = new GridArrangement(33, 22);
    Preondition Violations
    Unmatched statement f1=new GridArrangement(33,22); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
    6
    assertFalse(f1.equals(f2));
    6
    assertFalse(f1.equals(f2));
    6
    assertFalse(w1.equals(w2));
    Differences
    Expression1Expression2Difference
    f2w2VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    f1w1VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    6
    assertFalse(w1.equals(w2));
                                                  
    7
    w2 = new Week(2, 2002);
    Preondition Violations
    Unmatched statement w2=new Week(2,2002); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    7
    w2 = new Week(2, 2002);
    7
    f2 = new GridArrangement(33, 22);
    7
    f2 = new GridArrangement(33, 22);
    Preondition Violations
    Unmatched statement f2=new GridArrangement(33,22); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
    8
    assertTrue(f1.equals(f2));
    8
    assertTrue(f1.equals(f2));
    8
    assertTrue(w1.equals(w2));
    Differences
    Expression1Expression2Difference
    f2w2VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    f1w1VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    8
    assertTrue(w1.equals(w2));
                                                  
    9
    w1 = new Week(2, 2003);
    Preondition Violations
    Unmatched statement w1=new Week(2,2003); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    9
    w1 = new Week(2, 2003);
    9
    f1 = new GridArrangement(33, 44);
    9
    f1 = new GridArrangement(33, 44);
    Preondition Violations
    Unmatched statement f1=new GridArrangement(33,44); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                      
    10
    assertFalse(f1.equals(f2));
    10
    assertFalse(f1.equals(f2));
    10
    assertFalse(w1.equals(w2));
    Differences
    Expression1Expression2Difference
    f2w2VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    f1w1VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    10
    assertFalse(w1.equals(w2));
                                                    
    11
    w2 = new Week(2, 2003);
    Preondition Violations
    Unmatched statement w2=new Week(2,2003); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11
    w2 = new Week(2, 2003);
    11
    f2 = new GridArrangement(33, 44);
    11
    f2 = new GridArrangement(33, 44);
    Preondition Violations
    Unmatched statement f2=new GridArrangement(33,44); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
                                                                        
    12
    assertTrue(f1.equals(f2));
    12
    assertTrue(f1.equals(f2));
    12
    assertTrue(w1.equals(w2));
    Differences
    Expression1Expression2Difference
    f2w2VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    f1w1VARIABLE_NAME_MISMATCH
    org.jfree.chart.block.GridArrangementorg.jfree.data.time.WeekVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    • Make classes org.jfree.chart.block.GridArrangement and org.jfree.data.time.Week extend a common superclass
    12
    assertTrue(w1.equals(w2));
    Precondition Violations (24)
    Row Violation
    1Unmatched statement Week w1=new Week(1,2002); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement GridArrangement f1=new GridArrangement(11,22); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement Week w2=new Week(1,2002); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement GridArrangement f2=new GridArrangement(11,22); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    6Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    7Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    8Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    9Unmatched statement w1=new Week(2,2002); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    10Unmatched statement f1=new GridArrangement(33,22); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    11Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    12Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    13Unmatched statement w2=new Week(2,2002); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    14Unmatched statement f2=new GridArrangement(33,22); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    15Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    16Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    17Unmatched statement w1=new Week(2,2003); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    18Unmatched statement f1=new GridArrangement(33,44); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    19Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    20Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1
    21Unmatched statement w2=new Week(2,2003); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    22Unmatched statement f2=new GridArrangement(33,44); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    23Type org.jfree.chart.block.GridArrangement of variable f2 does not match with type org.jfree.data.time.Week of variable w2
    24Type org.jfree.chart.block.GridArrangement of variable f1 does not match with type org.jfree.data.time.Week of variable w1