ContactModel c = new ContactModel(); c.addEmail(new EmailModel("test@test.de", EmailModel.TYPE_HOME)); c.setNickName("nickname"); Object uid = getSourceFolder().add(c); assertNotNull(uid); assertEquals("nextUid", 1, getSourceFolder().getNextMessageUid());
XmlElement xml1 = new XmlElement(); XmlElement xml2 = new XmlElement(); xml1.setName("ONE"); xml2.setName("ONE"); xml1.addElement(new XmlElement("child1")); xml2.addElement(new XmlElement("child1")); assertEquals("The hashcode are not equal", xml2.hashCode(), xml1.hashCode());
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/test/java/org/columba/addressbook/folder/AddContactTest.java File path: /columba-1.4-src/core/src/test/java/org/columba/core/xml/XmlElementTest.java
Method name: void testAddContact() Method name: void testHashcode()
Number of AST nodes: 6 Number of AST nodes: 7
1
ContactModel c = new ContactModel();
2
		c.addEmail(new EmailModel("test@test.de", EmailModel.TYPE_HOME));
3
		c
1
XmlElement xml1 = new XmlElement();
2
        XmlElement xml2 = new XmlElement();
3
        xml1.setName("ONE");
4
.setNickName("nickname");
4
        xml2.setName("
5
		Object uid = getSourceFolder().add(c);
6
		assertNotNull(uid);
7
		assertEquals("nextUid", 1, getSourceFolder().getNextMessageUid
5
ONE");
6
        xml1.addElement(new XmlElement("child1"));
7
        xml2.addElement(new XmlElement("child1"));
8
        assertEquals("The hashcode are not equal", xml2.hashCode(),
8
());
9
            xml1.hashCode());
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 comparisons42
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment5
    Number of unmapped statements in the second code fragment6
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
                                                                            
    1
    XmlElement xml1 = new XmlElement();
    Preondition Violations
    Unmatched statement XmlElement xml1=new XmlElement(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    1
    XmlElement xml1 = new XmlElement();
    1
    ContactModel c = new ContactModel();
    1
    ContactModel c = new ContactModel();
    Preondition Violations
    Unmatched statement ContactModel c=new ContactModel(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                              
                                                                            
    2
    XmlElement xml2 = new XmlElement();
    Preondition Violations
    Unmatched statement XmlElement xml2=new XmlElement(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2
    XmlElement xml2 = new XmlElement();
    2
    c.addEmail(new EmailModel("test@test.de", EmailModel.TYPE_HOME));
    2
    c.addEmail(new EmailModel("test@test.de", EmailModel.TYPE_HOME));
    Preondition Violations
    Unmatched statement c.addEmail(new EmailModel("test@test.de",EmailModel.TYPE_HOME)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                                                                                                          
                                                  
    3
    xml1.setName("ONE");
    Preondition Violations
    Unmatched statement xml1.setName("ONE"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    xml1.setName("ONE");
    3
    c.setNickName("nickname");
    3
    c.setNickName("nickname");
    Preondition Violations
    Unmatched statement c.setNickName("nickname"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                              
                                                  
    4
    xml2.setName("ONE");
    Preondition Violations
    Unmatched statement xml2.setName("ONE"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4
    xml2.setName("ONE");
    4
    Object uid = getSourceFolder().add(c);
                                                                                  
                                                                                              
    5
    xml1.addElement(new XmlElement("child1"));
    Preondition Violations
    Unmatched statement xml1.addElement(new XmlElement("child1")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5
    xml1.addElement(new XmlElement("child1"));
                                                                                              
    6
    xml2.addElement(new XmlElement("child1"));
    Preondition Violations
    Unmatched statement xml2.addElement(new XmlElement("child1")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6
    xml2.addElement(new XmlElement("child1"));
    5
    assertNotNull(uid);
    5
    assertNotNull(uid);
    7
    assertEquals("The hashcode are not equal", xml2.hashCode(), xml1.hashCode());
    Differences
    Expression1Expression2Difference
    assertNotNullassertEqualsMETHOD_INVOCATION_NAME_MISMATCH
    assertNotNull(uid)assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode())ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression assertNotNull(uid) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(uid) is a void method call, and thus it cannot be parameterized
    Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized
    Expression assertNotNull(uid) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression assertNotNull(uid) is a void method call, and thus it cannot be parameterized
    Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized
    7
    assertEquals("The hashcode are not equal", xml2.hashCode(), xml1.hashCode());
    6
    assertEquals("nextUid", 1, getSourceFolder().getNextMessageUid());
                                                                                                                                          
    Precondition Violations (18)
    Row Violation
    1Unmatched statement XmlElement xml1=new XmlElement(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched statement ContactModel c=new ContactModel(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement XmlElement xml2=new XmlElement(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4Unmatched statement c.addEmail(new EmailModel("test@test.de",EmailModel.TYPE_HOME)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched statement xml1.setName("ONE"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    6Unmatched statement c.setNickName("nickname"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    7Unmatched statement xml2.setName("ONE"); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    8Unmatched statement xml1.addElement(new XmlElement("child1")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    9Unmatched statement xml2.addElement(new XmlElement("child1")); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    10Expression assertNotNull(uid) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    11Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    12Expression assertNotNull(uid) is a void method call, and thus it cannot be parameterized
    13Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized
    14Expression assertNotNull(uid) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    15Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    16Expression assertNotNull(uid) is a void method call, and thus it cannot be parameterized
    17Expression assertEquals("The hashcode are not equal",xml2.hashCode(),xml1.hashCode()) is a void method call, and thus it cannot be parameterized
    18The refactoring of the clones is infeasible, because classes org.columba.addressbook.folder.AddContactTest and org.columba.core.xml.XmlElementTest do not have a common superclass